← 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/Access.pm
StatementsExecuted 128 statements in 1.02ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5611425µs425µsFoswiki::Access::::getReasonFoswiki::Access::getReason
111132µs12.5msFoswiki::Access::::newFoswiki::Access::new
11130µs40µsFoswiki::Access::::BEGIN@13Foswiki::Access::BEGIN@13
11119µs62µsFoswiki::Access::::BEGIN@14Foswiki::Access::BEGIN@14
11119µs128µsFoswiki::Access::::BEGIN@16Foswiki::Access::BEGIN@16
1119µs9µsFoswiki::Access::::finishFoswiki::Access::finish
0000s0sFoswiki::Access::::haveAccessFoswiki::Access::haveAccess
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::Access
6
7A singleton object of this class manages the access control database.
8
9=cut
10
11package Foswiki::Access;
12
13256µs250µs
# spent 40µs (30+10) within Foswiki::Access::BEGIN@13 which was called: # once (30µs+10µs) by Foswiki::BEGIN@2053 at line 13
use strict;
# spent 40µs making 1 call to Foswiki::Access::BEGIN@13 # spent 10µs making 1 call to strict::import
14255µs2104µs
# spent 62µs (19+42) within Foswiki::Access::BEGIN@14 which was called: # once (19µs+42µs) by Foswiki::BEGIN@2053 at line 14
use Assert;
# spent 62µs making 1 call to Foswiki::Access::BEGIN@14 # spent 42µs making 1 call to Assert::import
15
162364µs2238µs
# spent 128µs (19+110) within Foswiki::Access::BEGIN@16 which was called: # once (19µs+110µs) by Foswiki::BEGIN@2053 at line 16
use constant MONITOR => 0;
# spent 128µs making 1 call to Foswiki::Access::BEGIN@16 # spent 110µs making 1 call to constant::import
17
18=begin TML
19
20---++ ClassMethod new($session)
21
22Constructor.
23
24=cut
25
26
# spent 12.5ms (132µs+12.3) within Foswiki::Access::new which was called: # once (132µs+12.3ms) by Foswiki::access at line 2054 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm
sub new {
276122µs my ( $class, $session ) = @_;
2814µs ASSERT( $session->isa('Foswiki') ) if DEBUG;
# spent 4µs making 1 call to Assert::ASSERTS_OFF
29 my $imp = $Foswiki::cfg{AccessControl} || 'Foswiki::Access::TopicACLAccess';
30
31 print STDERR "using $imp Access Control\n" if MONITOR;
32
33 eval("use $imp");
# spent 160µs executing statements in string eval
# includes 2.05ms spent executing 1 call to 1 sub defined therein.
34133µs my $this = $imp->new($session);
# spent 33µs making 1 call to Foswiki::Access::TopicACLAccess::new
35
36 return $this;
37}
38
39=begin TML
40
41---++ ObjectMethod finish()
42Break circular references.
43
44=cut
45
46# Note to developers; please undef *all* fields in the object explicitly,
47# whether they are references or not. That way this method is "golden
48# documentation" of the live fields in the object.
49
# spent 9µs within Foswiki::Access::finish which was called: # once (9µs+0s) by Foswiki::finish at line 2100 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm
sub finish {
50314µs my $this = shift;
51 undef $this->{failure};
52 undef $this->{session};
53}
54
55=begin TML
56
57---++ ObjectMethod getReason() -> $string
58
59Return a string describing the reason why the last access control failure
60occurred.
61
62=cut
63
64
# spent 425µs within Foswiki::Access::getReason which was called 56 times, avg 8µs/call: # 56 times (425µs+0s) by Foswiki::Meta::haveAccess at line 1837 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Meta.pm, avg 8µs/call
sub getReason {
65112408µs my $this = shift;
66 return $this->{failure};
67}
68
69=begin TML
70
71---++ ObjectMethod haveAccess($mode, $User, $web, $topic, $attachment) -> $boolean
72---++ ObjectMethod haveAccess($mode, $User, $meta) -> $boolean
73---++ ObjectMethod haveAccess($mode, $User, $address) -> $boolean
74
75 * =$mode= - 'VIEW', 'CHANGE', 'CREATE', etc. (defaults to VIEW)
76 * =$cUID= - Canonical user id (defaults to current user)
77Check if the user has the given mode of access to the topic. This call
78may result in the topic being read.
79
80=cut
81
82sub haveAccess {
83 die 'base class';
84}
85
8614µs1;
87
88# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
89#
90# Copyright (C) 2008-2011 Foswiki Contributors. Foswiki Contributors
91# are listed in the AUTHORS file in the root of this distribution.
92# NOTE: Please extend that file, not this notice.
93#
94# Additional copyrights apply to some or all of the code in this
95# file as follows:
96#
97# Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org
98# and TWiki Contributors. All Rights Reserved. TWiki Contributors
99# are listed in the AUTHORS file in the root of this distribution.
100#
101# This program is free software; you can redistribute it and/or
102# modify it under the terms of the GNU General Public License
103# as published by the Free Software Foundation; either version 2
104# of the License, or (at your option) any later version. For
105# more details read LICENSE in the root of this distribution.
106#
107# This program is distributed in the hope that it will be useful,
108# but WITHOUT ANY WARRANTY; without even the implied warranty of
109# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
110#
111# As per the GPL, removal of this notice is prohibited.