← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:26:33 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/AccessControlException.pm
StatementsExecuted 9 statements in 358µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11125µs32µsFoswiki::AccessControlException::::BEGIN@47Foswiki::AccessControlException::BEGIN@47
11116µs34µsFoswiki::AccessControlException::::BEGIN@48Foswiki::AccessControlException::BEGIN@48
1119µs9µsFoswiki::AccessControlException::::BEGIN@50Foswiki::AccessControlException::BEGIN@50
0000s0sFoswiki::AccessControlException::::newFoswiki::AccessControlException::new
0000s0sFoswiki::AccessControlException::::stringifyFoswiki::AccessControlException::stringify
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# See bottom of file for license and copyright information
2
3=begin TML
4
5---+ package Foswiki::AccessControlException
6
7Exception used raise an access control violation. This exception has the
8following fields:
9 * =web= - the web which was being accessed
10 * =topic= - the topic being accessed (if any)
11 * =user= - canonical username of the person doing the accessing. Use
12 the methods of the Foswiki::Users class to get more information about the
13 user.
14 * =mode= - the access mode e.g. CHANGE, VIEW etc
15 * =reason= a text string giving the reason for the refusal.
16
17The exception may be thrown by plugins. If a plugin throws the exception, it
18will normally be caught and the browser redirected to a login screen (if the
19user is not logged in) or reported (if they are and just don't have access).
20
21API version $Date$ (revision $Rev$)
22
23*Since* _date_ indicates where functions or parameters have been added since
24the baseline of the API (TWiki release 4.2.3). The _date_ indicates the
25earliest date of a Foswiki release that will support that function or
26parameter.
27
28*Deprecated* _date_ indicates where a function or parameters has been
29[[http://en.wikipedia.org/wiki/Deprecation][deprecated]]. Deprecated
30functions will still work, though they should
31_not_ be called in new plugins and should be replaced in older plugins
32as soon as possible. Deprecated parameters are simply ignored in Foswiki
33releases after _date_.
34
35*Until* _date_ indicates where a function or parameter has been removed.
36The _date_ indicates the latest date at which Foswiki releases still supported
37the function or parameter.
38
39=cut
40
41# THIS PACKAGE IS PART OF THE PUBLISHED API USED BY EXTENSION AUTHORS.
42# DO NOT CHANGE THE EXISTING APIS (well thought out extensions are OK)
43# AND ENSURE ALL POD DOCUMENTATION IS COMPLETE AND ACCURATE.
44
45package Foswiki::AccessControlException;
46
47246µs240µs
# spent 32µs (25+8) within Foswiki::AccessControlException::BEGIN@47 which was called: # once (25µs+8µs) by Foswiki::Plugin::BEGIN@14 at line 47
use strict;
# spent 32µs making 1 call to Foswiki::AccessControlException::BEGIN@47 # spent 8µs making 1 call to strict::import
48247µs252µs
# spent 34µs (16+18) within Foswiki::AccessControlException::BEGIN@48 which was called: # once (16µs+18µs) by Foswiki::Plugin::BEGIN@14 at line 48
use warnings;
# spent 34µs making 1 call to Foswiki::AccessControlException::BEGIN@48 # spent 18µs making 1 call to warnings::import
49
502248µs19µs
# spent 9µs within Foswiki::AccessControlException::BEGIN@50 which was called: # once (9µs+0s) by Foswiki::Plugin::BEGIN@14 at line 50
use Error ();
# spent 9µs making 1 call to Foswiki::AccessControlException::BEGIN@50
51110µsour @ISA = ('Error'); # base class
52
5311µsour $VERSION = '$Rev$';
54
55=begin TML
56
57---+ ClassMethod new($mode, $user, $web, $topic, $reason)
58
59 * =$mode= - mode of access (view, change etc)
60 * =$user= - canonical user name of user doing the accessing
61 * =$web= - web being accessed
62 * =$topic= - topic being accessed
63 * =$reason= - string reason for failure
64
65All the above fields are accessible from the object in a catch clause
66in the usual way e.g. =$e->{web}= and =$e->{reason}=
67
68=cut
69
70sub new {
71 my ( $class, $mode, $user, $web, $topic, $reason ) = @_;
72
73 return $class->SUPER::new(
74 web => $web,
75 topic => $topic,
76 user => $user,
77 mode => $mode,
78 reason => $reason,
79 );
80}
81
82=begin TML
83
84---++ ObjectMethod stringify() -> $string
85
86Generate a summary string. This is mainly for debugging.
87
88=cut
89
90sub stringify {
91 my $this = shift;
92 my $topic = $this->{topic}
93 || ''; # Access checks of Web objects causes uninitialized string errors
94 return
95"AccessControlException: Access to $this->{mode} $this->{web}.$topic for $this->{user} is denied. $this->{reason}";
96}
97
9816µs1;
99__END__