Fix the canEdit method in the Matrix.

This commit is contained in:
Colin Kuskie 2010-05-21 15:05:00 -07:00
parent bfbe11ae32
commit bf268bc66b

View file

@ -265,8 +265,7 @@ part of the C<groupToAdd> group.
=cut
sub canEdit {
my $orig = shift;
override canEdit => sub {
my $self = shift;
my $userId = shift || $self->session->user->userId;
@ -276,14 +275,8 @@ sub canEdit {
&& $form->get( 'class' )->isa( 'WebGUI::Asset::MatrixListing' ) ) {
return $self->canAddMatrixListing();
}
else {
if ($userId eq $self->ownerUserId) {
return 1;
}
my $user = WebGUI::User->new($self->session, $userId);
return $user->isInGroup($self->groupIdEdit);
}
}
return super();
};
#-------------------------------------------------------------------