diff options
author | Michael Scherer <misc@mageia.org> | 2011-07-21 16:50:31 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-07-21 16:50:31 +0000 |
commit | f40b65c3e1026f5cb96f705a92481ac38cb4c26c (patch) | |
tree | 956ec8fd21b3766a14a9c1099d35ef26a89e8d56 /lib/CatDap/Controller | |
parent | 6d861e125dff8edccdf6f4070fbb4642d0cd5c89 (diff) | |
download | identity-f40b65c3e1026f5cb96f705a92481ac38cb4c26c.tar identity-f40b65c3e1026f5cb96f705a92481ac38cb4c26c.tar.gz identity-f40b65c3e1026f5cb96f705a92481ac38cb4c26c.tar.bz2 identity-f40b65c3e1026f5cb96f705a92481ac38cb4c26c.tar.xz identity-f40b65c3e1026f5cb96f705a92481ac38cb4c26c.zip |
group the $mainrole related stuff together, check the permission after getting information on the role
Diffstat (limited to 'lib/CatDap/Controller')
-rw-r--r-- | lib/CatDap/Controller/admin.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CatDap/Controller/admin.pm b/lib/CatDap/Controller/admin.pm index 452efd9..dfea627 100644 --- a/lib/CatDap/Controller/admin.pm +++ b/lib/CatDap/Controller/admin.pm @@ -609,13 +609,13 @@ sub group : Local { sub group_modify : Local { my ( $self, $c, $group, $op, $attr, $value ) = @_; + $c->detach('/user/login') if not $c->user; + my $mainrole = 'account'; - if ( ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) { - $c->forward('/user'); - } $mainrole = 'group' if (not $c->check_user_roles('Account Admins')); $c->stash( subpages => gensubpages($mainrole) ); + my @errors; my @entries; my $mesg; @@ -632,6 +632,10 @@ sub group_modify : Local { $c->detach('/admin/group'); } + if ( ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) { + $c->forward('/user'); + } + if (defined $op and $op eq 'delete') { @entries = $mesg_group->entries; $entries[0]->delete( $attr => $value)->update; |