Fixing require loops. Moose overrides for canEdit using packages.

This commit is contained in:
Colin Kuskie 2010-04-08 15:13:13 -07:00
parent d69ed84fd4
commit c835344813
14 changed files with 69 additions and 60 deletions

View file

@ -136,16 +136,17 @@ You can't add children to a Story.
=cut
sub canEdit {
around canEdit => sub {
my $orig = shift;
my $self = shift;
my $userId = shift || $self->session->user->userId;
if ($userId eq $self->ownerUserId) {
return 1;
}
my $user = WebGUI::User->new($self->session, $userId);
return $self->SUPER::canEdit($userId)
return $self->$orig($userId)
|| $self->getArchive->canPostStories($userId);
}
};
#-------------------------------------------------------------------