XPressME Integration Kit

Trac

Version 1 から Version 2 における更新: TracFineGrainedPermissions

差分発生行の前後
Ignore:
Timestamp:
Nov 29, 2010, 3:25:28 PM (13 years 前)
Author:
trac (IP: 127.0.0.1)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracFineGrainedPermissions

    v1 v2  
    1 = 粒度が細かいパーミッション = #Finegrainedpermissions 
     1= Fine grained permissions = 
    22 
    3 Trac 0.11 より前は、リポジトリブラウザ サブシステムだけで「粒度が細かいパーミッション (fine grained permissions)」を定義することができました。 
     3Before Trac 0.11, it was only possible to define fine-grained permissions checks on the repository browser sub-system. 
    44 
    5 0.11 以降、カスタマイズしたパーミッションポリシーのプラグインを各所に使用するための共通のメカニズムが導入されたので、すべての種類の Trac リソースのあらゆるアクションについて、そのリソースの特定バージョンのレベルまで含めて許可/拒否を設定できるようになりました。 
     5Since 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. 
    66 
    7 == パーミッションポリシー == #PermissionPolicies 
     7Note that for Trac 0.12, `authz_policy` has been integrated in trunk branch as `tracopt.perm.authz_policy.*` 
    88 
    9 === !AuthzPolicy === #AuthzPolicy 
     9== Permission Policies == 
    1010 
    11 ポリシーの例として、 Authz 形式のシステムを基にしたポリシーが追加されました。詳しくは、 
    12 [http://trac.edgewall.org/browser/trunk/sample-plugins/permissions/authz_policy.py] を参照してください。 (より多くの例が [http://trac.edgewall.org/browser/trunk/sample-plugins/permissions] にあります。) 
     11=== !AuthzPolicy === 
    1312 
    14  - [http://www.voidspace.org.uk/python/configobj.html ConfigObj] をインストール (必須) 
    15  - authz_policy.py を plugins ディレクトリにコピーする 
    16  - [http://swapoff.org/files/authzpolicy.conf authzpolicy.conf] ファイルをどこか (できれば、 Web サーバ起動ユーザ以外が読み取りできないセキュアな領域) に置く。 
    17  - `trac.ini` ファイルをアップデートする: 
     13An example policy based on an Authz-style system has been added. See 
     14[trac:source:branches/0.11-stable/sample-plugins/permissions/authz_policy.py authz_policy.py] for details (current version requires >= Python 2.4). (See also [trac:source:branches/0.11-stable/sample-plugins/permissions sample-plugins/permissions] for more samples.) 
     15 
     16 - Install [http://www.voidspace.org.uk/python/configobj.html ConfigObj] (required). 
     17 - 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. 
     19 - Update your `trac.ini`: 
     20   1. modify the [TracIni#trac-section permission_policies] entry in the `[trac]` section 
    1821{{{ 
    1922[trac] 
    2023... 
    2124permission_policies = AuthzPolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy 
    22  
     25}}} 
     26   2. add a new `[authz_policy]` section 
     27{{{ 
    2328[authz_policy] 
    2429authz_file = /some/trac/env/conf/authzpolicy.conf 
    25  
     30}}} 
     31   3. enable the single file plugin 
     32{{{ 
    2633[components] 
    2734... 
    28 authz_policy = enabled 
     35authz_policy.* = enabled 
    2936}}} 
    3037 
    31 パーミッションポリシーを指定する順序はとても重要です。 
    32 ポリシーは設定された順序で評価されます。 
     38Note that the order in which permission policies are specified is quite critical,  
     39as policies will be examined in the sequence provided. 
    3340 
    34 個々のポリシーはパーミッションチェックに対して `True`, `False`, `None` を返します。 
    35 戻り値が `None` の場合のみ ''次の'' パーミッションポリシーに問い合わせを行います。 
    36 どのポリシーも明示的にパーミッションを許可しない場合、最終的な結果は `False` になります 
    37 (つまり、権限なしとみなされます)。 
     41A policy will return either `True`, `False` or `None` for a given permission check. 
     42Only if the return value is `None` will the ''next'' permission policy be consulted. 
     43If no policy explicitly grants the permission, the final result will be `False`  
     44(i.e. no permission). 
    3845 
    39 例えば、 `authz_file` が次の内容を含み: 
     46For example, if the `authz_file` contains: 
    4047{{{ 
    4148[wiki:WikiStart@*] 
     
    4653* = 
    4754}}} 
    48 デフォルトパーミッションが次のような内容の場合: 
     55and the default permissions are set like this: 
    4956{{{ 
    5057john           WIKI_VIEW 
    5158jack           WIKI_VIEW 
    52 # anonymous に WIKI_VIEW は付与されていない 
     59# anonymous has no WIKI_VIEW 
    5360}}} 
    5461 
    55 パーミッションは以下の通りとなります: 
    56  - WikiStart の全てのバージョンは、 (匿名ユーザも含む) 全員が閲覧できます。 
    57  - !PrivatePage は john が表示可能です。 
    58  - 他のページは john と jack が表示可能です。 
     62Then:  
     63 - All versions of WikiStart will be viewable by everybody (including anonymous) 
     64 - !PrivatePage will be viewable only by john 
     65 - other pages will be viewable only by john and jack 
    5966 
    6067 
    61 === mod_authz_svn ライクなパーミッションポリシー === #mod_authz_svn-likepermissionpolicy 
     68=== mod_authz_svn-like permission policy === 
    6269 
    63 この文書が書かれている時点では、 Trac 0.10 以前にリポジトリへの厳密なアクセス制御に使用されていた、古い「粒度が細かいパーミッション」システムは、まだパーミッションポリシーのコンポーネントにコンバートされていません。しかし、ユーザの視点では、実現できる機能に大きな違いはありません。 
     70At the time of this writing, the old fine grained permissions system from Trac 0.10 and before used for restricting access to the repository has not yet been converted to a permission policy component, but from the user point of view, this makes little if no difference. 
    6471 
    65 「粒度が細かいパーミッション」の制御に定義ファイルを必要とします。この定義ファイルは Subversion の mod_authz_svn で使用しているものを使います。 
    66 このファイルの形式と Subversion での用法に関する情報は [http://svnbook.red-bean.com/svnbook/book.html#svn-ch-6-sect-4.4.2 Subversion Book (ディレクトリごとのアクセス制御)] を参照してください。 
     72That kind of fine-grained permission control needs a definition file, which is the one used by Subversion's mod_authz_svn.  
     73More 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. 
    6774 
    68 : 
     75Example: 
    6976{{{ 
    7077[/] 
     
    7986}}} 
    8087 
    81  * '''/''' = ''全員 read アクセスが可能です。これはデフォルトの動作となります'' 
    82  * '''/branches/calc/bug-142''' = ''harry は read/write アクセス権を持ち、 sally は read アクセス権のみを持ちます'' 
    83  * '''/branches/calc/bug-142/secret''' = ''harry はアクセス権を持たず、 sally は read アクセス権を持ちます (パーミッションはサブフォルダに継承されます)'' 
     88 * '''/''' = ''Everyone has read access by default'' 
     89 * '''/branches/calc/bug-142''' = ''harry has read/write access, sally read only'' 
     90 * '''/branches/calc/bug-142/secret''' = ''harry has no access, sally has read access (inherited as a sub folder permission)'' 
    8491 
    85 ==== Trac の設定 ==== #TracConfiguration 
     92==== Trac Configuration ==== 
    8693 
    87 「粒度が細かいパーミッション」を有効にするには、 trac.ini ファイルの {{{[trac]}}} セクションに {{{authz_file}}} オプションを __設定しなければなりません__ 。オプションが空値に設定されていたり、そもそも指定されていない場合、パーミッションは適用されません。 
     94To 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. 
    8895 
    8996{{{ 
     
    9299}}} 
    93100 
    94 `auth_file` 内でシンタックス `[`''modulename''`:/`''some''`/`''path''`]` を使用する場合、以下の設定を追加してください: 
     101If you want to support the use of the `[`''modulename''`:/`''some''`/`''path''`]` syntax within the `authz_file`, add  
    95102 
    96103{{{ 
     
    98105}}} 
    99106 
    100 ''modulename'' には、 `[trac]` セクション中の `repository_dir` に設定したリポジトリと同じものを設定します。 (訳注: Subversion で `SVNParentPath` を使用して複数のリポジトリをホストしている場合のリポジトリ指定方法です。 ''modulename'' は個々のリポジトリを指します。) 
     107where ''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: 
    101108 
    102 '''Note:''' Authz ファイルで使用するユーザ名と、 Trac で使用するユーザ名は __同じでなければなりません__。 
     109{{{  
     110[trac] 
     111authz_file = /path/to/svnaccessfile 
     112authz_module_name = blahblah 
     113... 
     114repository_dir = /srv/active/svn/blahblah  
     115}}} 
    103116 
    104 ==== Subversion の設定 ==== #SubversionConfiguration 
     117where the svn access file, {{{/path/to/svnaccessfile}}}, contains entries such as {{{[blahblah:/some/path]}}}. 
    105118 
    106 通常は同じアクセスファイルを対応する Subversion リポジトリに適用します。 Apache のディレクティブには以下のように設定してください: 
     119'''Note:''' Usernames inside the Authz file __must__ be the same as those used inside trac.  
     120 
     121==== Subversion Configuration ==== 
     122 
     123The same access file is typically applied to the corresponding Subversion repository using an Apache directive like this: 
    107124{{{ 
    108125<Location /repos> 
     
    115132}}} 
    116133 
    117 複数のプロジェクト Environment において、プロジェクト全体にどのようにアクセス制限を行うかについての情報は [http://trac.edgewall.org/wiki/TracMultipleProjectsSVNAccess] を参照してください。 
     134For information about how to restrict access to entire projects in a multiple project environment see [trac:wiki:TracMultipleProjectsSVNAccess] 
     135 
     136== Getting TracFineGrainedPermissions to work == 
     137 
     138Don't forget to restart Trac engine to apply new configuration if you are running tracd standalone server. 
    118139 
    119140---- 
    120 See also: TracPermissions 
     141See also: TracPermissions, 
     142[http://trac-hacks.org/wiki/FineGrainedPageAuthzEditorPlugin TracHacks:FineGrainedPageAuthzEditorPlugin] for a simple editor plugin.