Changes between Version 3 and Version 4 of TracFineGrainedPermissions
- Timestamp:
- Apr 4, 2012, 2:28:20 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracFineGrainedPermissions
v3 v4 4 4 5 5 Since 0.11, there'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. 6 7 Note that for Trac 0.12, `authz_policy` has been integrated in trunk branch as `tracopt.perm.authz_policy.*`8 6 9 7 == Permission Policies == … … 16 14 - Install [http://www.voidspace.org.uk/python/configobj.html ConfigObj] (required). 17 15 - Copy authz_policy.py into your plugins directory. 18 - 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.16 - 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. 19 17 - Update your `trac.ini`: 20 1. modify the [TracIni#trac-section permission_policies] entry in the `[trac]` section21 18 {{{ 22 19 [trac] 23 20 ... 24 21 permission_policies = AuthzPolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy 25 }}} 26 2. add a new `[authz_policy]` section 27 {{{ 22 28 23 [authz_policy] 29 24 authz_file = /some/trac/env/conf/authzpolicy.conf 30 }}} 31 3. enable the single file plugin 32 {{{ 25 33 26 [components] 34 27 ... 35 authz_policy .*= enabled28 authz_policy = enabled 36 29 }}} 37 30 … … 71 64 72 65 That kind of fine-grained permission control needs a definition file, which is the one used by Subversion's mod_authz_svn. 73 More information about this file format and about its usage in Subversion is available in the [http://svnbook.red-bean.com/en/1.5/svn.serverconfig.pathbasedauthz.html Path-Based Authorization] section in the Server Configuration chapter of the svn book.66 More information about this file format and about its usage in Subversion is available in the [http://svnbook.red-bean.com/svnbook/book.html#svn-ch-6-sect-4.4.2 Subversion Book (Per-Directory Access Control)]. 74 67 75 68 Example: … … 103 96 }}} 104 97 105 If you want to support the use of the `[`''modulename''`:/`''some''`/`''path''`]` syntax within the `authz_file`, add98 if you want to support the use of the `[`''modulename''`:/`''some''`/`''path''`]` syntax within the `authz_file`, add 106 99 107 100 {{{ … … 109 102 }}} 110 103 111 where ''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 {{{ 112 /srv/active/svn/blahblah 113 }}}, that would yield the following: 114 115 {{{ 116 [trac] 117 authz_file = /path/to/svnaccessfile 118 authz_module_name = blahblah 119 ... 120 repository_dir = /srv/active/svn/blahblah 121 }}} 122 123 where the svn access file, {{{ 124 /path/to/svnaccessfile 125 }}}, contains entries such as {{{ 126 [blahblah:/some/path] 127 }}}. 104 where ''modulename'' refers to the same repository indicated by the `repository_dir` entry in the `[trac]` section. 128 105 129 106 '''Note:''' Usernames inside the Authz file __must__ be the same as those used inside trac. … … 149 126 150 127 ---- 151 See also: TracPermissions ,152 [http://trac-hacks.org/wiki/FineGrainedPageAuthzEditorPlugin TracHacks:FineGrainedPageAuthzEditorPlugin]for a simple editor plugin.128 See also: TracPermissions 129 http://trac-hacks.org/wiki/FineGrainedPageAuthzEditorPlugin for a simple editor plugin.