]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FPagePermissions
Use UTF-8 so that display is correct on sf.net
[SourceForge/phpwiki.git] / pgsrc / Help%2FPagePermissions
1 Date: Thu, 26 Mar 2009 11:34:32 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FPagePermissions;
6   flags=PAGE_LOCKED;
7   markup=2;
8   charset=UTF-8
9 Content-Transfer-Encoding: binary
10
11 == Full recursive ACL page permissions support (Solaris / Windows style)
12
13 Boolean permissions per page and action (*granted* or *denied*) based on the current users
14 group membership is implemented with ACL's (Access Control Lists).
15 Opposed to the simplier unix like ugo:rwx system. <br>
16 The previous system was only based on action and current user, independent of pages.
17
18 A individual page permission may be inherited from its parent pages, and
19 from an optional master page ("." or _dotpage'). <br>
20 Use predefined default permissions, if a "." page does not exist. <br>
21 Pagenames starting with "." have tighter default permissions. (edit, change, list disallowed)
22
23 === Order of Evaluation (denial overrides granted, or vice versa?)
24
25 The array of permissions is evaluated from top to bottom. <br>
26 Access is granted if the next matching *group membership* returns true, denied if false. <br>
27 If the group membership is false, the next group is tried. <br>
28 If no group membership matches the upper permissions are tried recursively: <br>
29   current page => basepage => "." page => default perms. <br>
30 If no group-perm pair grants access, access is denied.
31
32 Consider the following perm:
33 {{{
34      'change' => array(ACL_ADMIN => false,
35                        ACL_OWNER => true));
36 }}}
37   => "Members of ADMIN may not change, the owner may change."
38
39 -----
40
41 For Authentication see ~WikiUserNew.php, ~WikiGroup.php and main.php
42
43 I suspect ACL page permissions to degrade performance by 10%
44
45 Enable/Disable it in config/config.ini:
46
47   ENABLE_PAGEPERM = true
48
49 The defined (and extendable) main.php actions map to simplier access types:
50 {{{
51        browse => view
52        edit   => edit
53        create => edit or create
54        remove => remove
55        rename => change
56        store prefs => change
57        list in PageList => list
58 }}}
59
60 For simplicity we also map the ACL to the posix-style _owner_, _group_ and _world_ groups
61 and _read_, _write_, _execute_ perms, in cygwin fashion.
62
63 == Groups - definition of group membership
64
65 See WikiGroup how to enable and where to store user-specific group membership.
66 Group methods: database, file, ldap, wikipage, none
67
68 ToDo: _explain better._
69
70 The following special groups are always predefined, even if no other group methods are provided:
71
72 * _EVERY
73 * _ANONYMOUS
74 * _BOGOUSER
75 * _HASHOMEPAGE
76 * _SIGNED
77 * _AUTHENTICATED
78 * _ADMIN
79 * _OWNER
80 * _CREATOR
81
82 Those special groups are stored in a page acl as locale-independent string.
83   *Todo*: See the available translations for these special groups.
84 Other group names are safed as defined by the group methods. (e.g. "Other Users")
85
86 == Perms - mapping of actions to permissions
87
88 PhpWiki supports individual actions, the default is browse. To simplify ACL's these
89 actions are mapped to some special permissions (vulgo _'perms'_).
90
91 We currently support the following permissions which can be stored in every page, for every group.
92
93 * 'list'     List this page and all subpages (for PageList)
94 * 'view'     View this page and all subpages
95 * 'edit'     Edit this page and all subpages
96 * 'create'   Create a new (sub)page
97 * 'dump'     Download the page contents
98 * 'change'   Change page attributes
99 * 'remove'   Remove this page
100
101 There are no plans to support additional custom perms. The API can handle that, but there's no UI,
102 and it would be only specific for certain plugins, which check permissions by their own.
103
104 === Action <=> Perm mapping
105
106 Those perms are mapped to those actions. [ActionPages|Help:ActionPage] (plugins) check their access restrictions by themselves.
107
108 list:
109   _none, 'list' is checked for every pagename listed in PageList, to prevent from being listed in AllPages._
110
111 view:
112   browse, viewsource, diff, select, xmlrpc, search, pdf
113
114 dump:
115   zip, ziphtml, dumpserial, dumphtml
116
117 edit:
118   revert, edit
119
120 create:
121   _edit or create, if the page doesn't exist yet_
122
123 change:
124   upload, loadfile, remove, lock, unlock, upgrade, chown, setacl, rename. %%%
125   all other actionpages which are not wikiwords.
126
127 === Default Permissions
128
129 {{{
130         $perm = array('view'   => array(ACL_EVERY => true),
131                       'edit'   => array(ACL_EVERY => true),
132                       'create' => array(ACL_EVERY => true),
133                       'list'   => array(ACL_EVERY => true),
134                       'remove' => array(ACL_ADMIN => true,
135                                         ACL_OWNER => true),
136                       'change' => array(ACL_ADMIN => true,
137                                         ACL_OWNER => true));
138         if (ZIPDUMP_AUTH)
139             $perm['dump'] = array(ACL_ADMIN => true,
140                                   ACL_OWNER => true);
141         else
142             $perm['dump'] = array(ACL_EVERY => true);
143         // view:
144         if (!ALLOW_ANON_USER) {
145             if (!ALLOW_USER_PASSWORDS)
146                 $perm['view'] = array(ACL_SIGNED => true);
147             else
148                 $perm['view'] = array(ACL_AUTHENTICATED => true);
149             $perm['view'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
150         }
151         // edit:
152         if (!ALLOW_ANON_EDIT) {
153             if (!ALLOW_USER_PASSWORDS)
154                 $perm['edit'] = array(ACL_SIGNED => true);
155             else
156                 $perm['edit'] = array(ACL_AUTHENTICATED => true);
157             $perm['edit'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
158             $perm['create'] = $perm['edit'];
159         }
160         return $perm;
161 }}}
162
163 <noinclude>
164 ----
165 [[PhpWikiDocumentation]]
166 </noinclude>