1 # <a name="Package <code>TWiki::Access="></a> Package =TWiki::Access
3 A singleton object of this class manages the access control database.
7 <li><a href="#Package =TWiki::Access="> Package TWiki::Access</a><ul>
8 <li><a href="#ClassMethod <strong>new</strong> ($session)"> ClassMethod new <tt>($session)</tt></a></li>
9 <li><a href="#ObjectMethod <strong>finish</strong> ()"> ObjectMethod finish <tt>()</tt></a></li>
10 <li><a href="#ObjectMethod <strong>getReason</strong> () -> $"> ObjectMethod getReason <tt>() -> $string</tt></a></li>
11 <li><a href="#ObjectMethod *check_AccessPermis"> ObjectMethod checkAccessPermission <tt>($action,$user,$text,$meta,$topic,$web) -> $boolean</tt></a></li>
17 ## <a name="ClassMethod <strong>new</strong> ($session)"></a> [[ClassMethod]] **new** `($session)`
21 ## <a name="ObjectMethod <strong>finish</strong> ()"></a> [[ObjectMethod]] **finish** `()`
23 Break circular references.
25 ## <a name="ObjectMethod <strong>getReason</strong> () - $s"></a> [[ObjectMethod]] **getReason** `() -> $string`
27 Return a string describing the reason why the last access control failure occurred.
29 ## <a name="ObjectMethod <strong>check_AccessPermis"></a> [[ObjectMethod]] \*checkAccessPermission `($action,$user,$text,$meta,$topic,$web) -> $boolean`
31 Check if user is allowed to access topic
33 - `$action` - 'VIEW', 'CHANGE', 'CREATE', etc.
34 - `$user` - User id (**not** wikiname)
35 - `$text` - If undef or '': Read '$theWebName.$theTopicName' to check permissions
36 - `$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.
37 - `$topic` - Topic name to check, e.g. 'SomeTopic' \*undef to check web perms only)
38 - `$web` - Web, e.g. 'Know'
40 If the check fails, the reason can be recoveered using getReason.