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. |