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