Changes between Version 9 and Version 10 of TracConfigurablePermissionPlugin
- Timestamp:
- Jan 15, 2018, 10:03:20 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracConfigurablePermissionPlugin
v9 v10 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = TracConfigurablePermissionPlugin 3 = Configure permissions on tickets and wiki pages 4 4 5 {{{#!box info 5 NOT FULLY TESTED, USE WITH CAUTION!! 6 '''Caution''': this plugin has not been fully tested, please proceed with caution! 6 7 }}} 7 8 8 9 == Description 9 10 10 This plugin provides configurable and powerful permission control to ticket and wiki system.11 This plugin provides configurable and powerful permission control to Trac's ticket and wiki system. 11 12 12 13 === Custom Actions/Permissions 14 13 15 Supports for adding custom actions and permissions in trac.ini section {{{configurable-permission}}}. 14 16 15 Syntax: {{{ (action_name) = enabled|disabled}}}, where:16 * (action_name): The action/permission you want to add. Will auto capitalized in Trac.17 * enabled|disabled: Ifthe action is enabled/disabled.17 Syntax: {{{(action_name) = enabled|disabled}}}, where: 18 * (action_name): The action/permission you want to add. Will be auto capitalized in Trac. 19 * enabled|disabled: Whether the action is enabled/disabled. 18 20 19 21 Examples: 20 {{{ 22 {{{#!ini 21 23 [configurable-permission] 22 24 view_bug_ticket = enabled … … 25 27 26 28 === Custom permission rules/policy 27 Supports for adding custom permission rules to ticket and wiki system.28 29 29 To enable this function, first add 'ConfigurablePermissionPolicy' to {{{permission_policies}}} option, prior to DefaultPermissionPolicy recommanded. 30 {{{ 30 Supports for adding custom permission rules to ticket and wiki system. This plugin would be useful in circumstances where more fine-grained control over what users can and cannot do to tickets or wiki pages is required. 31 32 To enable this function, first add 'ConfigurablePermissionPolicy' to {{{permission_policies}}} option, and preferably prior to DefaultPermissionPolicy. 33 {{{#!ini 31 34 [trac] 32 35 permission_policies = ConfigurablePermissionPolicy,ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy 33 36 }}} 34 37 35 Syntax for a custom permission rule: {{{(rule_name) = ticket|wiki, (action), (matching_condition), (permission), (result)}}}, where:36 * (rule_name): The rule name, which does not really affect the function of rule. However the trac will auto sort the trac.ini, andorder of rules matters, so the naming should consider sorting.37 * ticket|wiki: Whether the rule applies to ticket system or wiki system.38 * (action): What action triggers the rule. Can be set to empty or '*' to match all actions, or set to a specific action such as 'TICKET_VIEW'39 * (matching_condition): Only those objects that match the conditions apply to the rule.40 * for ticket permission rule, it can be set to empty or '*' to match all tickets, or set to a query such as 'type=bug' 41 * for wiki permission rule, it matches the name of wiki42 * (permission): Those users with given permission applies to the rule. Can be set to empty or '*' which means everyone. Can be used with custom permission mentioned above, such as 'VIEW_BUG_TICKET'43 * (result): What will the permission system do to matched objects, can be one of the following values:44 * allow: Explicitly allow this action, no further policy group will be applied.45 * allow-only: Explicitly allow this action, and deny all other users without the given permission. No further policy group will be applied.46 * deny: Explicitly deny this action, No further policy group will be applied.47 * pass: Leave this action to further policy groups, such as DefaultPermissionPolicy. Recommanded against 'allow'.48 * pass-only: Leave this action to further policy groups, such as DefaultPermissionPolicy, and deny all other users without the given permission. Recommanded against 'allow-only'.38 Syntax for a custom permission rule: {{{(rule_name) = ticket|wiki, (action), (matching_condition), (permission), (result)}}}, where: 39 * `(rule_name)`: The rule name, which does not really affect the function of the rule. However, Trac will auto sort the trac.ini, and the order of rules matters, so the naming should consider sorting. 40 * `ticket|wiki`: Whether the rule applies to tickets or the wiki. 41 * `(action)`: What action triggers the rule. Can be set to empty or '*' to match all actions, or set to a specific action such as `TICKET_VIEW`. 42 * `(matching_condition)`: Only those objects that match the conditions apply to the rule. 43 * for ticket permission rule, it can be set to empty or '*' to match all tickets, or set to a query such as 'type=bug'. 44 * for wiki permission rule, it matches the name of the wiki page. 45 * `(permission)`: Those users with given permission applies to the rule. Can be set to empty or '*' which means everyone. Can be used with custom permission mentioned above, such as `VIEW_BUG_TICKET`. 46 * `(result)`: What will the permission system do to matched objects, can be one of the following values: 47 * `allow`: Explicitly allow this action, no further policy group will be applied. 48 * `allow-only`: Explicitly allow this action, and deny all other users without the given permission. No further policy group will be applied. 49 * `deny`: Explicitly deny this action, No further policy group will be applied. 50 * `pass`: Leave this action to further policy groups, such as DefaultPermissionPolicy. Recommended against 'allow'. 51 * `pass-only`: Leave this action to further policy groups, such as DefaultPermissionPolicy, and deny all other users without the given permission. Recommended against 'allow-only'. 49 52 50 Example 1:51 {{{ 53 '''Example 1''': 54 {{{#!ini 52 55 [configurable-permission-rules] 53 56 view_bug = ticket, TICKET_VIEW, type=bug, VIEW_BUG_TICKET, pass-only 54 57 }}} 55 This rule reads: 'Pass user with VIEW_BUG_TICKET permission for viewing tickets that matches type=bug, and deny those users without VIEW_BUG_TICKET permission'58 This rule reads: Pass user with `VIEW_BUG_TICKET` permission for viewing tickets that matches type=bug, and deny those users without `VIEW_BUG_TICKET` permission. 56 59 This rule is equivalent to: 57 60 {{{ … … 59 62 view_bug2 = ticket, TICKET_VIEW, type=bug, VIEW_BUG_TICKET, pass 60 63 }}} 61 Important: the order of rules matters. Trac will auto sort t rac.ini options according to option names, so make sure your rule name implies a correct order.64 Important: the order of rules matters. Trac will auto sort the trac.ini options according to option names, so make sure your rule name implies a correct order. 62 65 63 Example 2:64 {{{ 66 '''Example 2''': 67 {{{#!ini 65 68 [configurable-permission-rules] 66 69 view_feature_wiki = wiki, *, Feature, VIEW_BUG_WIKI, deny 67 70 }}} 68 This rule reads: 'Deny all user with VIEW_BUG_WIKI permission for all actions to wiki naming Feature'71 This rule reads: Deny all user with `VIEW_BUG_WIKI` permission for all actions to wiki naming feature. 69 72 70 Example 3:71 {{{ 73 '''Example 3''': 74 {{{#!ini 72 75 [configurable-permission-rules] 73 76 owner_edit_only = ticket, TICKET_EDIT, owner=$OWNER, *, allow-only 74 77 }}} 75 This rule reads: 'Only the owner of ticket can modify it.'78 This rule reads: Only the owner of the ticket can modify it. 76 79 77 80 == !Bugs/Feature Requests