fixed #12129: AdminBar calls canAdd as an object method

This commit is contained in:
Paul Driver 2011-05-16 16:10:18 -05:00
parent 0df9fb747a
commit c1a29182ca
4 changed files with 31 additions and 3 deletions

View file

@ -226,6 +226,10 @@ The "turn admin on" group which is group id 12.
sub canAdd {
my $className = shift;
# just in case we get called as object method
$className = $className->get('className') if blessed $className;
my $session = shift;
my $userId = shift || $session->user->userId;
my $user = WebGUI::User->new($session, $userId);