data/TWiki/TWikiAccessDotPm.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 ---+ Package =TWiki::Access=
     2 
     3 A singleton object of this class manages the access control database.
     4 
     5 
     6 %TOC%
     7 
     8 ---++ ClassMethod *new* <tt>($session)</tt>
     9 
    10 Constructor.
    11 
    12 
    13 
    14 ---++ ObjectMethod *finish* <tt>()</tt>
    15 Break circular references.
    16 
    17 
    18 
    19 ---++ ObjectMethod *getReason* <tt>() -> $string</tt>
    20 
    21 Return a string describing the reason why the last access control failure
    22 occurred.
    23 
    24 
    25 
    26 ---++ ObjectMethod *checkAccessPermission* <tt>($action,$user,$text,$meta,$topic,$web) -> $boolean</tt>
    27 
    28 Check if user is allowed to access topic
    29    * =$action=  - 'VIEW', 'CHANGE', 'CREATE', etc.
    30    * =$user=    - User id (*not* wikiname)
    31    * =$text=    - If undef or '': Read '$theWebName.$theTopicName' to check permissions
    32    * =$meta=    - If undef, but =$text= is defined, then metadata will be parsed from =$text=. If defined, then metadata embedded in =$text= will be ignored. Always ignored if =$text= is undefined. Settings in =$meta= override * Set settings in plain text.
    33    * =$topic=   - Topic name to check, e.g. 'SomeTopic' *undef to check web perms only)
    34    * =$web=     - Web, e.g. 'Know'
    35 If the check fails, the reason can be recoveered using getReason.
    36 
    37