]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FPagePermissions
Wikicreole syntax
[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.0RC1)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FPagePermissions;
6   flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
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. \\
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'). \\
20 Use predefined default permissions, if a "." page does not exist. \\
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. \\
26 Access is granted if the next matching **group membership** returns true, denied if false. \\
27 If the group membership is false, the next group is tried. \\
28 If no group membership matches the upper permissions are tried recursively: \\
29   current page => basepage => "." page => default perms. \\
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 To do: _explain better._
69
70 The following special groups are always predefined, even if no other group methods are provided:
71 * _EVERY
72 * _ANONYMOUS
73 * _BOGOUSER
74 * _HASHOMEPAGE
75 * _SIGNED
76 * _AUTHENTICATED
77 * _ADMIN
78 * _OWNER
79 * _CREATOR
80
81 Those special groups are stored in a page acl as locale-independent string.
82
83 **To do**: See the available translations for these special groups.
84
85 Other group names are safed as defined by the group methods. (e.g. "Other Users")
86
87 == Perms - mapping of actions to permissions ==
88
89 ~PhpWiki supports individual actions, the default is browse. To simplify ACL's these
90 actions are mapped to some special permissions (vulgo _'perms'_).
91
92 We currently support the following permissions which can be stored in every page, for every group.
93
94 |= list   | List this page and all subpages (for PageList)
95 |= view   | View this page and all subpages
96 |= edit   | Edit this page and all subpages
97 |= create | Create a new (sub)page
98 |= dump   | Download the page contents
99 |= change | Change page attributes
100 |= remove | Remove this page
101
102 There are no plans to support additional custom perms. The API can handle that, but there's no UI,
103 and it would be only specific for certain plugins, which check permissions by their own.
104
105 === Action <=> Perm mapping ===
106
107 Those perms are mapped to those actions. [[Help:ActionPage|Action Pages]] (plugins) check their access restrictions by themselves.
108
109 |= list   | //none, 'list' is checked for every pagename listed in PageList, to prevent from being listed in AllPages.//
110 |= view   | browse, viewsource, diff, select, xmlrpc, search, pdf
111 |= dump   | zip, ziphtml, dumpserial, dumphtml
112 |= edit   | revert, edit
113 |= create | //edit or create, if the page doesn't exist yet//
114 |= change | upload, loadfile, remove, lock, unlock, upgrade, chown, setacl, setaclsimple, rename. \\ All other actionpages which are not wikiwords.
115
116 === Default Permissions ===
117
118 {{{
119         $perm = array('view'   => array(ACL_EVERY => true),
120                       'edit'   => array(ACL_EVERY => true),
121                       'create' => array(ACL_EVERY => true),
122                       'list'   => array(ACL_EVERY => true),
123                       'remove' => array(ACL_ADMIN => true,
124                                         ACL_OWNER => true),
125                       'change' => array(ACL_ADMIN => true,
126                                         ACL_OWNER => true));
127         if (ZIPDUMP_AUTH)
128             $perm['dump'] = array(ACL_ADMIN => true,
129                                   ACL_OWNER => true);
130         else
131             $perm['dump'] = array(ACL_EVERY => true);
132         // view:
133         if (!ALLOW_ANON_USER) {
134             if (!ALLOW_USER_PASSWORDS)
135                 $perm['view'] = array(ACL_SIGNED => true);
136             else
137                 $perm['view'] = array(ACL_AUTHENTICATED => true);
138             $perm['view'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
139         }
140         // edit:
141         if (!ALLOW_ANON_EDIT) {
142             if (!ALLOW_USER_PASSWORDS)
143                 $perm['edit'] = array(ACL_SIGNED => true);
144             else
145                 $perm['edit'] = array(ACL_AUTHENTICATED => true);
146             $perm['edit'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
147             $perm['create'] = $perm['edit'];
148         }
149         return $perm;
150 }}}
151
152 <noinclude>
153 ----
154 [[PhpWikiDocumentation]]
155 </noinclude>