do not make a user object unless it is needed
This commit is contained in:
parent
9289bdb34c
commit
3f393980c4
1 changed files with 1 additions and 1 deletions
|
|
@ -239,10 +239,10 @@ Unique hash identifier for a user. If not supplied, current user.
|
||||||
sub canEdit {
|
sub canEdit {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $userId = shift || $self->session->user->userId;
|
my $userId = shift || $self->session->user->userId;
|
||||||
my $user = WebGUI::User->new($self->session, $userId);
|
|
||||||
if ($userId eq $self->get("ownerUserId")) {
|
if ($userId eq $self->get("ownerUserId")) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
my $user = WebGUI::User->new($self->session, $userId);
|
||||||
return $user->isInGroup($self->get("groupIdEdit"));
|
return $user->isInGroup($self->get("groupIdEdit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue