1 # <a name="Package <code>TWiki::_AccessControlEx"></a> Package =TWiki::AccessControlException
3 Exception used raise an access control violation. This exception has the following fields:
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.
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).
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>() -> $string</tt></a></li>
23 ## <a name="ClassMethod <strong>new</strong> ($mode,$user,$"></a> [[ClassMethod]] **new** `($mode,$user,$web,$topic,$reason)`
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
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}`
33 ## <a name="ObjectMethod <strong>stringify</strong> () - $s"></a> [[ObjectMethod]] **stringify** `() -> $string`
35 Generate a summary string. This is mainly for debugging.