Edgewall Software

Changes between Version 77 and Version 78 of TracPermissions


Ignore:
Timestamp:
Dec 8, 2010, 5:09:03 PM (13 years ago)
Author:
Remy Blank
Comment:

Moved 0.11-specific information to 0.11/TracPermissions.

Legend:

Unmodified
Added
Removed
Modified
  • TracPermissions

    v77 v78  
    9898
    9999To create custom permissions, for example to be used in a custom workflow, enable the optional `tracopt.perm.config_perm_provider.ExtraPermissionsProvider` component in the "Plugins" admin panel, and add the desired permissions to the `[extra-permissions]` section in your [wiki:TracIni#extra-permissions-section trac.ini]. For more information, please refer to the documentation of the component in the admin panel.
    100 
    101 For Trac 0.11
    102 
    103 From http://nil.checksite.co.uk/index.cfm/2008/1/14/trac-0-11-creating-your-own-permissions
    104 
    105 To add permissions to Trac 0.11 you simply need to add a myPermissions.py file to your Trac environment plugin folder that looks like this:
    106 
    107 
    108 {{{
    109 from trac.core import Component, implements
    110 from trac.perm import IPermissionRequestor
    111 class MyPermissions(Component):
    112     implements(IPermissionRequestor)
    113     def get_permission_actions(self):
    114         #comma separated list of new permissions
    115         return ('TICKET_CLOSE','TICKET_DEFER')
    116 }}}
    117 
    118 Add your set of permissions to the return command in place of 'MY_FIRST_PERM', 'MY_SECOND_PERM', restart apache and you should be away.
    119 
    120 You can now use these permission in your work flow against actionname.permissions entries.
    121 
    122 NOTE: you don't need to call the file "myPermissions.py" - its just needs to be a python file with a name of your choosing.
    123100
    124101== Granting Privileges ==