Edgewall Software

Changes between Version 76 and Version 77 of TracPermissions


Ignore:
Timestamp:
Dec 8, 2010, 4:29:11 PM (13 years ago)
Author:
plittle@…
Comment:

Needed information for Trac 0.11, as VisualSVN doesn't like Trac 0.12

Legend:

Unmodified
Added
Removed
Modified
  • TracPermissions

    v76 v77  
    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
     101For Trac 0.11
     102
     103From http://nil.checksite.co.uk/index.cfm/2008/1/14/trac-0-11-creating-your-own-permissions
     104
     105To 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{{{
     109from trac.core import Component, implements
     110from trac.perm import IPermissionRequestor
     111class 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
     118Add 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
     120You can now use these permission in your work flow against actionname.permissions entries.
     121
     122NOTE: you don't need to call the file "myPermissions.py" - its just needs to be a python file with a name of your choosing.
    100123
    101124== Granting Privileges ==