Skip to content

Commit

Permalink
simplify authorization bridges
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Aug 19, 2014
1 parent 12bed4a commit af5f2c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Galileo.pm
Expand Up @@ -202,8 +202,7 @@ sub startup {

my $if_author = $r->under( sub {
my $self = shift;
return $self->auth_fail unless $self->is_author;
return 1;
return $self->is_author || $self->auth_fail;
});

$if_author->any( '/admin/menu' )->to('menu#edit');
Expand All @@ -214,8 +213,7 @@ sub startup {

my $if_admin = $r->under( sub {
my $self = shift;
return $self->auth_fail unless $self->is_admin;
return 1;
return $self->is_admin || $self->auth_fail;
});

$if_admin->any( '/admin/users' )->to('admin#users');
Expand Down

0 comments on commit af5f2c6

Please sign in to comment.