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:
Colin Kuskie 2006-03-15 22:41:23 +00:00
parent 951c6a5889
commit 5c00dfcfda

View file

@ -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);