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