User->isInGroup no longer takes a userId as an argument.
Have to create a user object with the right Id and then call it with all groups to check.
This commit is contained in:
parent
951c6a5889
commit
5c00dfcfda
1 changed files with 2 additions and 1 deletions
|
|
@ -127,10 +127,11 @@ Unique hash identifier for a user. If not specified, uses current userId.
|
|||
sub canView {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
my $user = WebGUI::User->new($self->session, $userId);
|
||||
return 0 unless ($self->get("state") eq "published");
|
||||
if ($userId eq $self->get("ownerUserId")) {
|
||||
return 1;
|
||||
} elsif ($self->session->user->isInGroup($self->get("groupIdView"),$userId)) {
|
||||
} elsif ($user->isInGroup($self->get("groupIdView"))) {
|
||||
return 1;
|
||||
}
|
||||
return $self->canEdit($userId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue