Edgewall Software

Changes between Version 74 and Version 75 of TracPermissions


Ignore:
Timestamp:
Dec 8, 2010, 3:16:41 PM (13 years ago)
Author:
plittle@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracPermissions

    v74 v75  
    9595|| `CONFIG_VIEW` || Enables additional pages on ''About Trac'' that show the current configuration or the list of installed plugins ||
    9696|| `EMAIL_VIEW` || Shows email addresses even if [trac:wiki:0.11/TracIni trac show_email_addresses configuration option is false] ||
     97
     98== Creating New Privileges ==
     99From [http://nil.checksite.co.uk/index.cfm/2008/1/14/trac-0-11-creating-your-own-permissions]
     100
     101To add permissions to you simply need to add a myPermissions.py file to your Trac environment plugin folder that looks like this:
     102
     103
     104{{{
     105from trac.core import Component, implements
     106from trac.perm import IPermissionRequestor
     107class MyPermissions(Component):
     108    implements(IPermissionRequestor)
     109    def get_permission_actions(self):
     110        #comma separated list of new permissions
     111        return ('TICKET_CLOSE','TICKET_DEFER')
     112}}}
     113
     114Add your set of permissions to the return command in place of 'MY_FIRST_PERM', 'MY_SECOND_PERM', restart apache and you should be away.
     115
     116You can now use these permission in your work flow against actionname.permissions entries.
     117
     118NOTE: you don't need to call the file "myPermissions.py" - its just needs to be a python file with a name of your choosing.
    97119
    98120== Granting Privileges ==