Edgewall Software

Changes between Version 59 and Version 60 of TracFineGrainedPermissions


Ignore:
Timestamp:
Nov 20, 2014, 5:55:21 PM (9 years ago)
Author:
Ryan J Ollos
Comment:

Remove info for AuthzPolicy in Trac 0.11.

Legend:

Unmodified
Added
Removed
Modified
  • TracFineGrainedPermissions

    v59 v60  
    55There's a general mechanism in place that allows custom **permission policy plugins** to grant or deny any action on any kind of Trac resources, even at the level of specific versions of such resources.
    66
    7 Note that for Trac 0.12, `authz_policy` has been integrated as an optional module (in `tracopt.perm.authz_policy.*`), so it's installed by default and can simply be activated via the //Plugins// panel in the Trac administration module.
     7That mechanism is `authz_policy`, which is an optional module (in `tracopt.perm.authz_policy.*`), so it's installed by default and can simply be activated via the //Plugins// panel in the Trac administration module.
    88
    99
     
    1414Which policies are currently active is determined by a configuration setting in TracIni:
    1515e.g.
    16 {{{
     16{{{#!ini
    1717[trac]
    1818permission_policies = AuthzSourcePolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy
     
    2121
    2222Among the possible optional choices, there is [#AuthzPolicy], a very generic permission policy, based on an Authz-style system. See
    23 [trac:source:branches/0.12-stable/tracopt/perm/authz_policy.py authz_policy.py] for details.
     23[trac:source:branches/1.0-stable/tracopt/perm/authz_policy.py authz_policy.py] for details.
    2424
    2525Another popular permission policy [#AuthzSourcePolicy], re-implements the pre-0.12 support for checking fine-grained permissions limited to Subversion repositories in terms of the new system.
    2626
    27 See also [trac:source:branches/0.12-stable/sample-plugins/permissions sample-plugins/permissions] for more examples.
     27See also [trac:source:branches/1.0-stable/sample-plugins/permissions sample-plugins/permissions] for more examples.
    2828
    2929
    3030=== !AuthzPolicy ===
    3131==== Configuration ====
    32 * Install [http://www.voidspace.org.uk/python/configobj.html ConfigObj] (still needed for 0.12 and later).
    33 * Copy [trac:browser:/trunk/tracopt/perm/authz_policy.py /tracopt/perm/authz_policy.py] to your environment's plugins directory (only for Trac 0.11).
     32* Install [http://www.voidspace.org.uk/python/configobj.html ConfigObj].
    3433* Put a [http://swapoff.org/files/authzpolicy.conf authzpolicy.conf] file somewhere, preferably on a secured location on the server, not readable for others than the webuser. If the  file contains non-ASCII characters, the UTF-8 encoding should be used.
    3534* Update your `trac.ini`:
    3635  1. modify the [TracIni#trac-section permission_policies] entry in the `[trac]` section
    37 {{{
     36{{{#!ini
    3837[trac]
    3938...
     
    4140}}}
    4241  1. add a new `[authz_policy]` section
    43 {{{
     42{{{#!ini
    4443[authz_policy]
    4544authz_file = /some/trac/env/conf/authzpolicy.conf
    4645}}}
    4746  1. enable the plugin through [/admin/general/plugin WebAdmin] or by editing the `[components]` section
    48 {{{
     47{{{#!ini
    4948[components]
    5049...
    5150# Trac 0.12
    5251tracopt.perm.authz_policy.* = enabled
    53 # for Trac 0.11 use this
    54 #authz_policy.* = enabled
    5552}}}
    5653
     
    6764
    6865The `authzpolicy.conf` file is a `.ini` style configuration file:
    69 {{{
     66{{{#!ini
    7067[wiki:PrivatePage@*]
    7168john = WIKI_VIEW, !WIKI_MODIFY
     
    8380
    8481  Example: Match the WikiStart page
    85 {{{
     82{{{#!ini
    8683[wiki:*]
    8784[wiki:WikiStart*]
     
    9289  Example: Match the attachment `wiki:WikiStart@117/attachment:FOO.JPG@*`
    9390  on WikiStart
    94 {{{
     91{{{#!ini
    9592[wiki:*]
    9693[wiki:WikiStart*]
     
    112109
    113110For example, if the `authz_file` contains:
    114 {{{
     111{{{#!ini
    115112[wiki:WikiStart@*]
    116113* = WIKI_VIEW
     
    133130
    134131Groups:
    135 {{{
     132{{{#!ini
    136133[groups]
    137134admins = john, jack
     
    154151
    155152Some repository examples (Browse Source specific):
    156 {{{
     153{{{#!ini
    157154# A single repository:
    158155[repository:test_repo@*]
     
    172169
    173170Very fine grain repository access:
    174 {{{
     171{{{#!ini
    175172# John has BROWSER_VIEW and FILE_VIEW access to trunk/src/some/location/ only
    176173[repository:test_repo@*/source:trunk/src/some/location/*@*]
     
    200197
    201198You cannot do the following:
    202 {{{
     199{{{#!ini
    203200[groups]
    204201team1 = a, b, c
     
    209206
    210207Permission groups are not supported either. You cannot do the following:
    211 {{{
     208{{{#!ini
    212209[groups]
    213210permission_level_1 = WIKI_VIEW, TICKET_VIEW
     
    227224
    228225Example:
    229 {{{
     226{{{#!ini
    230227[/]
    231228* = r
     
    247244To activate fine grained permissions you __must__ specify the {{{authz_file}}} option in the {{{[trac]}}} section of trac.ini. If this option is set to null or not specified the permissions will not be used.
    248245
    249 {{{
     246{{{#!ini
    250247[trac]
    251248authz_file = /path/to/svnaccessfile
     
    254251If you want to support the use of the `[`''modulename''`:/`''some''`/`''path''`]` syntax within the `authz_file`, add
    255252
    256 {{{
     253{{{#!ini
    257254authz_module_name = modulename
    258255}}}
     
    260257where ''modulename'' refers to the same repository indicated by the `repository_dir` entry in the `[trac]` section. As an example, if the `repository_dir` entry in the `[trac]` section is {{{/srv/active/svn/blahblah}}}, that would yield the following:
    261258
    262 {{{
     259{{{ #!ini
    263260[trac]
    264261authz_file = /path/to/svnaccessfile
     
    274271As of version 0.12, make sure you have ''!AuthzSourcePolicy'' included in the permission_policies list in trac.ini, otherwise the authz permissions file will be ignored.
    275272
    276 {{{ 
     273{{{#!ini
    277274[trac]
    278275permission_policies = AuthzSourcePolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy
     
    282279
    283280The same access file is typically applied to the corresponding Subversion repository using an Apache directive like this:
    284 {{{
     281{{{#!apache
    285282<Location /repos>
    286283  DAV svn
     
    296293== Debugging permissions
    297294In trac.ini set:
    298 {{{
     295{{{#!ini
    299296[logging]
    300297log_file = trac.log
     
    304301
    305302And watch:
    306 {{{
     303{{{#!sh
    307304tail -n 0 -f log/trac.log | egrep '\[perm\]|\[authz_policy\]'
    308305}}}