Edgewall Software

Changes between Version 15 and Version 16 of CookBook/PermissionPolicies


Ignore:
Timestamp:
Jan 24, 2018, 5:33:04 AM (6 years ago)
Author:
Ryan J Ollos
Comment:

Document how to restrict to reporter (gmessage:trac-users:vRN1Vgcb5Zk/P_0TqauhBAAJ), and fix error in permission name.

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/PermissionPolicies

    v15 v16  
    3535
    3636    implements(IPermissionPolicy, IPermissionRequestor)
     37
     38    _field = 'owner'
    3739
    3840    # IPermissionRequestor methods
     
    5355                pass
    5456            else:
    55                 if ticket['owner'] != username:
     57                if ticket[self._field] != username:
    5658                    return 'TICKET_ADMIN' in perm
    5759}}}
    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:
    5961 {{{#!ini
    6062 [trac]
    61  permission_policies = RestrictTicketActions, ...
     63 permission_policies = RestrictTicketActionsPolicy, ...
    6264}}}
    6365 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:
     
    6769}}}
    6870 1. Grant the `TICKET_CHANGE_STATE` permission to your users.
     71
     72The permission policy can be applied to the ticket reporter rather than the ticket owner by changing the `_field` class attribute from `'owner'` to `'reporter'`.
    6973
    7074== Grant a permission to the Ticket Owner