Diff: Help/PagePermissions

Note: You are viewing an old revision of this page. View the current version.

Differences between version 5 and previous revision of Help/PagePermissions.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 5 Last edited on 9 September 2007 0:16 by harold Revert
Older page: version 4 Last edited on 22 May 2014 3:01 by harold Revert
@@ -1,64 +1,65 @@
-== Full recursive ACL page permissions support (Solaris / Windows style) ==  
+!!! Full recursive ACL page permissions support (Solaris / Windows style) 
  
-Boolean permissions per page and action (* *granted* * or * *denied* *) based on the current users 
+Boolean permissions per page and action (*granted* or *denied*) based on the current users 
 group membership is implemented with ACL's (Access Control Lists). 
-Opposed to the simplier unix like ugo:rwx system. \\  
+Opposed to the simplier unix like ugo:rwx system. <br>  
 The previous system was only based on action and current user, independent of pages. 
  
 A individual page permission may be inherited from its parent pages, and 
-from an optional master page ("." or _dotpage'). \\  
-Use predefined default permissions, if a "." page does not exist. \\  
+from an optional master page ("." or _dotpage'). <br>  
+Use predefined default permissions, if a "." page does not exist. <br>  
 Pagenames starting with "." have tighter default permissions. (edit, change, list disallowed) 
  
-=== Order of Evaluation (denial overrides granted, or vice versa?) ==  
+! Order of Evaluation (denial overrides granted, or vice versa?) 
  
-The array of permissions is evaluated from top to bottom. \\  
-Access is granted if the next matching * *group membership* * returns true, denied if false. \\  
-If the group membership is false, the next group is tried. \\  
-If no group membership matches the upper permissions are tried recursively: \\  
- current page => basepage => "." page => default perms. \\  
+The array of permissions is evaluated from top to bottom. <br>  
+Access is granted if the next matching *group membership* returns true, denied if false. <br>  
+If the group membership is false, the next group is tried. <br>  
+If no group membership matches the upper permissions are tried recursively: <br>  
+ current page => basepage => "." page => default perms. <br>  
 If no group-perm pair grants access, access is denied. 
  
 Consider the following perm: 
-{{{  
+<verbatim>  
  'change' => array(ACL_ADMIN => false, 
  ACL_OWNER => true)); 
-}}}  
+</verbatim>  
  => "Members of ADMIN may not change, the owner may change." 
  
 ----- 
  
 For Authentication see ~WikiUserNew.php, ~WikiGroup.php and main.php 
-  
+Page Permissions are in PhpWiki since v1.3.9.  
 I suspect ACL page permissions to degrade performance by 10% 
  
 Enable/Disable it in config/config.ini: 
  
  ENABLE_PAGEPERM = true 
  
 The defined (and extendable) main.php actions map to simplier access types: 
-{{{  
+<verbatim>  
  browse => view 
  edit => edit 
  create => edit or create 
  remove => remove 
  rename => change 
  store prefs => change 
  list in PageList => list 
-}}}  
+</verbatim>  
  
 For simplicity we also map the ACL to the posix-style _owner_, _group_ and _world_ groups 
 and _read_, _write_, _execute_ perms, in cygwin fashion. 
  
-== Groups - definition of group membership ==  
+!!! Groups - definition of group membership 
  
-See ~ WikiGroup how to enable and where to store user-specific group membership. 
+See WikiGroup how to enable and where to store user-specific group membership. 
 Group methods: database, file, ldap, wikipage, none 
  
-To do : _explain better._ 
+ToDo : _explain better._ 
  
 The following special groups are always predefined, even if no other group methods are provided: 
+  
 * _EVERY 
 * _ANONYMOUS 
 * _BOGOUSER 
 * _HASHOMEPAGE 
@@ -68,45 +69,55 @@
 * _OWNER 
 * _CREATOR 
  
 Those special groups are stored in a page acl as locale-independent string. 
-  
-**To do **: See the available translations for these special groups.  
-  
+ *Todo *: See the available translations for these special groups. 
 Other group names are safed as defined by the group methods. (e.g. "Other Users") 
  
-== Perms - mapping of actions to permissions ==  
+!!! Perms - mapping of actions to permissions 
  
-~ PhpWiki supports individual actions, the default is browse. To simplify ACL's these 
+PhpWiki supports individual actions, the default is browse. To simplify ACL's these 
 actions are mapped to some special permissions (vulgo _'perms'_). 
  
 We currently support the following permissions which can be stored in every page, for every group. 
  
-|= list | List this page and all subpages (for PageList)  
-|= view | View this page and all subpages  
-|= edit | Edit this page and all subpages  
-|= create | Create a new (sub)page  
-|= dump | Download the page contents  
-|= change | Change page attributes  
-|= remove | Remove this page 
+* ' list' List this page and all subpages (for PageList)  
+* ' view' View this page and all subpages  
+* ' edit' Edit this page and all subpages  
+* ' create' Create a new (sub)page  
+* ' dump' Download the page contents  
+* ' change' Change page attributes  
+* ' remove' Remove this page 
  
 There are no plans to support additional custom perms. The API can handle that, but there's no UI, 
 and it would be only specific for certain plugins, which check permissions by their own. 
  
-=== Action <=> Perm mapping ===  
+! Action <=> Perm mapping 
  
-Those perms are mapped to those actions. [[ Help:ActionPage|Action Pages] ] (plugins) check their access restrictions by themselves. 
+Those perms are mapped to those actions. [ActionPages| Help:ActionPage] (plugins) check their access restrictions by themselves. 
  
-|= list | // none, 'list' is checked for every pagename listed in PageList, to prevent from being listed in AllPages.//  
-|= view | browse, viewsource, diff, select, xmlrpc, search, pdf  
-|= dump | zip, ziphtml, dumpserial, dumphtml  
-|= edit | revert, edit  
-|= create | //edit or create, if the page doesn't exist yet//  
-|= change | upload, loadfile, remove, lock, unlock, upgrade, chown, setacl, setaclsimple, rename. \\ All other actionpages which are not wikiwords.  
+list:  
+ _ none, 'list' is checked for every pagename listed in PageList, to prevent from being listed in AllPages._  
  
-=== Default Permissions ===  
+view:  
+ browse, viewsource, diff, select, xmlrpc, search, pdf  
  
-{{{  
+dump:  
+ zip, ziphtml, dumpserial, dumphtml  
+  
+edit:  
+ revert, edit  
+  
+create:  
+ _edit or create, if the page doesn't exist yet_  
+  
+change:  
+ upload, loadfile, remove, lock, unlock, upgrade, chown, setacl, rename. %%%  
+ all other actionpages which are not wikiwords.  
+  
+!! Default Permissions  
+  
+<verbatim>  
  $perm = array('view' => array(ACL_EVERY => true), 
  'edit' => array(ACL_EVERY => true), 
  'create' => array(ACL_EVERY => true), 
  'list' => array(ACL_EVERY => true), 
@@ -121,25 +132,24 @@
  $perm['dump'] = array(ACL_EVERY => true); 
  // view: 
  if (!ALLOW_ANON_USER) { 
  if (!ALLOW_USER_PASSWORDS) 
- $perm['view'] = array(ACL_SIGNED => true); 
+ $perm['view'] = array(ACL_SIGNED => true); 
  else 
- $perm['view'] = array(ACL_AUTHENTICATED => true); 
+ $perm['view'] = array(ACL_AUTHENTICATED => true); 
  $perm['view'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false; 
 
  // edit: 
  if (!ALLOW_ANON_EDIT) { 
  if (!ALLOW_USER_PASSWORDS) 
- $perm['edit'] = array(ACL_SIGNED => true); 
+ $perm['edit'] = array(ACL_SIGNED => true); 
  else 
- $perm['edit'] = array(ACL_AUTHENTICATED => true); 
+ $perm['edit'] = array(ACL_AUTHENTICATED => true); 
  $perm['edit'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false; 
  $perm['create'] = $perm['edit']; 
 
  return $perm; 
-}}}  
+</verbatim>  
  
-<noinclude>  
-----  
-[[ PhpWikiDocumentation]]  
-</noinclude>  
+Source: [PhpWikiCvs:lib/PagePerm.php]  
+- ----  
+PhpWikiDocumentation 

version 5

Full recursive ACL page permissions support (Solaris / Windows style)

Boolean permissions per page and action (granted or denied) based on the current users group membership is implemented with ACL's (Access Control Lists). Opposed to the simplier unix like ugo:rwx system.
The previous system was only based on action and current user, independent of pages.

A individual page permission may be inherited from its parent pages, and from an optional master page ("." or _dotpage').
Use predefined default permissions, if a "." page does not exist.
Pagenames starting with "." have tighter default permissions. (edit, change, list disallowed)

Order of Evaluation (denial overrides granted, or vice versa?)

The array of permissions is evaluated from top to bottom.
Access is granted if the next matching group membership returns true, denied if false.
If the group membership is false, the next group is tried.
If no group membership matches the upper permissions are tried recursively:

current page => basepage => "." page => default perms.

If no group-perm pair grants access, access is denied.

Consider the following perm:

     'change' => array(ACL_ADMIN => false,
                       ACL_OWNER => true));

=> "Members of ADMIN may not change, the owner may change."


For Authentication see WikiUserNew.php, WikiGroup.php and main.php Page Permissions are in PhpWiki since v1.3.9. I suspect ACL page permissions to degrade performance by 10%

Enable/Disable it in config/config.ini
ENABLE_PAGEPERM = true

The defined (and extendable) main.php actions map to simplier access types:

       browse => view
       edit   => edit
       create => edit or create
       remove => remove
       rename => change
       store prefs => change
       list in PageList => list

For simplicity we also map the ACL to the posix-style owner, group and world groups and read, write, execute perms, in cygwin fashion.

Groups - definition of group membership

See WikiGroup how to enable and where to store user-specific group membership. Group methods: database, file, ldap, wikipage, none

ToDo: explain better.

The following special groups are always predefined, even if no other group methods are provided:

  • _EVERY
  • _ANONYMOUS
  • _BOGOUSER
  • _HASHOMEPAGE
  • _SIGNED
  • _AUTHENTICATED
  • _ADMIN
  • _OWNER
  • _CREATOR

Those special groups are stored in a page acl as locale-independent string.

Todo: See the available translations for these special groups.

Other group names are safed as defined by the group methods. (e.g. "Other Users")

Perms - mapping of actions to permissions

PhpWiki supports individual actions, the default is browse. To simplify ACL's these actions are mapped to some special permissions (vulgo 'perms').

We currently support the following permissions which can be stored in every page, for every group.

  • 'list' List this page and all subpages (for PageList)
  • 'view' View this page and all subpages
  • 'edit' Edit this page and all subpages
  • 'create' Create a new (sub)page
  • 'dump' Download the page contents
  • 'change' Change page attributes
  • 'remove' Remove this page

There are no plans to support additional custom perms. The API can handle that, but there's no UI, and it would be only specific for certain plugins, which check permissions by their own.

Action <=> Perm mapping

Those perms are mapped to those actions. ActionPages (plugins) check their access restrictions by themselves.

list
none, 'list' is checked for every pagename listed in PageList, to prevent from being listed in AllPages.
view
browse, viewsource, diff, select, xmlrpc, search, pdf
dump
zip, ziphtml, dumpserial, dumphtml
edit
revert, edit
create
edit or create, if the page doesn't exist yet
change
upload, loadfile, remove, lock, unlock, upgrade, chown, setacl, rename.
all other actionpages which are not wikiwords.

Default Permissions

        $perm = array('view'   => array(ACL_EVERY => true),
                      'edit'   => array(ACL_EVERY => true),
                      'create' => array(ACL_EVERY => true),
                      'list'   => array(ACL_EVERY => true),
                      'remove' => array(ACL_ADMIN => true,
                                        ACL_OWNER => true),
                      'change' => array(ACL_ADMIN => true,
                                        ACL_OWNER => true));
        if (ZIPDUMP_AUTH)
            $perm['dump'] = array(ACL_ADMIN => true,
                                  ACL_OWNER => true);
        else
            $perm['dump'] = array(ACL_EVERY => true);
        // view:
        if (!ALLOW_ANON_USER) {
            if (!ALLOW_USER_PASSWORDS)
                $perm['view'] = array(ACL_SIGNED => true);
            else
                $perm['view'] = array(ACL_AUTHENTICATED => true);
            $perm['view'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
        }
        // edit:
        if (!ALLOW_ANON_EDIT) {
            if (!ALLOW_USER_PASSWORDS)
                $perm['edit'] = array(ACL_SIGNED => true);
            else
                $perm['edit'] = array(ACL_AUTHENTICATED => true);
            $perm['edit'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false;
            $perm['create'] = $perm['edit'];
        }
        return $perm;

Source: PhpWikiCvs:lib/PagePerm.php


PhpWikiDocumentation