fixed a bug where userId was not checked unless explicitly passed into canView
This commit is contained in:
parent
4cb7c98a16
commit
22c2102e5a
1 changed files with 9 additions and 3 deletions
|
|
@ -152,10 +152,16 @@ Unique hash identifier for a user. If not specified, uses current userId.
|
|||
|
||||
sub canView {
|
||||
my $self = shift;
|
||||
my $userId = shift;
|
||||
my $user = $self->session->user;
|
||||
$user = WebGUI::User->new($self->session, $userId) if (defined $userId);
|
||||
my $eh = $self->session->errorHandler;
|
||||
my $userId = shift;
|
||||
my $user;
|
||||
if (defined $userId) {
|
||||
$user = WebGUI::User->new($self->session, $userId);
|
||||
}
|
||||
else {
|
||||
$user = $self->session->user;
|
||||
$userId = $user->userId();
|
||||
}
|
||||
if ($userId eq $self->get("ownerUserId")) {
|
||||
return 1;
|
||||
} elsif ($user->isInGroup($self->get("groupIdView"))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue