Fixing require loops. Moose overrides for canEdit using packages.
This commit is contained in:
parent
d69ed84fd4
commit
c835344813
14 changed files with 69 additions and 60 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue