From: tla Date: Tue, 4 Sep 2012 09:40:36 +0000 (+0200) Subject: fix logic bug for admin textinfo edit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38093cb0060141c31bd2a56ae9c4f481ddee1b1e;p=scpubgit%2Fstemmatology.git fix logic bug for admin textinfo edit --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Root.pm b/stemmaweb/lib/stemmaweb/Controller/Root.pm index 9d18c67..d4184aa 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Root.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Root.pm @@ -223,7 +223,8 @@ sub textinfo :Local :Args(1) { if( exists $params->{'owner'} ) { # Only admins can update user / owner my $newownerid = delete $params->{'owner'}; - unless( $tradition->has_user && $tradition->user->id eq $newownerid ) { + unless( !$newownerid || + ( $tradition->has_user && $tradition->user->id eq $newownerid ) ) { unless( $c->user->get_object->is_admin ) { return _json_error( $c, 403, "Only admin users can change tradition ownership" );