From: Tara L Andrews Date: Sun, 2 Sep 2012 21:35:57 +0000 (+0200) Subject: fix another bug in permissions logic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1517440c8ef89b70b35aa50852baa26f1c71d56;p=scpubgit%2Fstemmatology.git fix another bug in permissions logic --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Relation.pm b/stemmaweb/lib/stemmaweb/Controller/Relation.pm index 2e9d444..043a52f 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Relation.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Relation.pm @@ -379,11 +379,13 @@ sub reading :Chained('text') :PathPart :Args(1) { sub _check_permission { my( $c, $tradition ) = @_; my $user = $c->user_exists ? $c->user->get_object : undef; + # Does this user have access? if( $user ) { - $c->stash->{'permission'} = 'full' - if( $user->is_admin || - ( $tradition->has_user && $tradition->user->id eq $user->id ) ); - return 1; + if( $user->is_admin || + ( $tradition->has_user && $tradition->user->id eq $user->id ) ) { + $c->stash->{'permission'} = 'full'; + return 1; + } } # Is it public? if( $tradition->public ) {