Changes between Version 15 and Version 16 of CookBook/PermissionPolicies
- Timestamp:
- Jan 24, 2018, 5:33:04 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/PermissionPolicies
v15 v16 35 35 36 36 implements(IPermissionPolicy, IPermissionRequestor) 37 38 _field = 'owner' 37 39 38 40 # IPermissionRequestor methods … … 53 55 pass 54 56 else: 55 if ticket[ 'owner'] != username:57 if ticket[self._field] != username: 56 58 return 'TICKET_ADMIN' in perm 57 59 }}} 58 1. Edit the `permission_policies` option in the [TracIni#trac-section "[trac]"] section of trac.ini, adding the `RestrictTicketActions ` component ''before'' the default [TracPermissions permission] policy:60 1. Edit the `permission_policies` option in the [TracIni#trac-section "[trac]"] section of trac.ini, adding the `RestrictTicketActionsPolicy` component ''before'' the default [TracPermissions permission] policy: 59 61 {{{#!ini 60 62 [trac] 61 permission_policies = RestrictTicketActions , ...63 permission_policies = RestrictTicketActionsPolicy, ... 62 64 }}} 63 65 1. Require `TICKET_CHANGE_STATE` for one or more workflow actions. For example, the [TracWorkflow#Environmentscreatedwith0.11 default workflow] could be modified so that only the ticket owner can assign tickets: … … 67 69 }}} 68 70 1. Grant the `TICKET_CHANGE_STATE` permission to your users. 71 72 The permission policy can be applied to the ticket reporter rather than the ticket owner by changing the `_field` class attribute from `'owner'` to `'reporter'`. 69 73 70 74 == Grant a permission to the Ticket Owner