none
[openafs-wiki.git] / TWiki / TWikiAccessControlExceptionDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::_AccessControlEx"></a> Package =TWiki::AccessControlException
2
3 Exception used raise an access control violation. This exception has the following fields:
4
5 - `web` - the web which was being accessed
6 - `topic` - the topic being accessed (if any)
7 - `user` - canonical username of the person doing the accessing. Use the methods of the TWiki::Users class to get more information about the user.
8 - `mode` - the access mode e.g. CHANGE, VIEW etc
9 - `reason` a text string giving the reason for the refusal.
10
11 The exception may be thrown by plugins. If a plugin throws the exception, it will normally be caught and the browser redirected to a login screen (if the user is not logged in) or reported (if they are and just don't have access).
12
13 <div>
14   <ul>
15     <li><a href="#Package =TWiki::_AccessControlEx"> Package TWiki::AccessControlException</a><ul>
16         <li><a href="#ClassMethod <strong>new</strong> ($mode,$user,$"> ClassMethod new <tt>($mode,$user,$web,$topic,$reason)</tt></a></li>
17         <li><a href="#ObjectMethod <strong>stringify</strong> () -> $"> ObjectMethod stringify <tt>() -&gt; $string</tt></a></li>
18       </ul>
19     </li>
20   </ul>
21 </div>
22
23 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; ($mode,$user,$"></a> [[ClassMethod]] **new** `($mode,$user,$web,$topic,$reason)`
24
25 - `$mode` - mode of access (view, change etc)
26 - `$user` - canonical user name of user doing the accessing
27 - `$web` - web being accessed
28 - `$topic` - topic being accessed
29 - `$reason` - string reason for failure
30
31 All the above fields are accessible from the object in a catch clause in the usual way e.g. `$e->{web}` and `$e->{reason}`
32
33 ## <a name="ObjectMethod &lt;strong&gt;stringify&lt;/strong&gt; () - $s"></a> [[ObjectMethod]] **stringify** `() -> $string`
34
35 Generate a summary string. This is mainly for debugging.