aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CatDap/Controller
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-07-21 17:10:36 +0000
committerMichael Scherer <misc@mageia.org>2011-07-21 17:10:36 +0000
commit403a3234914fbfe4f215ecefcfe3dbef95e6a16e (patch)
tree7c953965f2c026bf2ca56e503a4c35b00e0435cc /lib/CatDap/Controller
parent58cc2964a962b537e3d856775b9e451c65e10516 (diff)
downloadidentity-403a3234914fbfe4f215ecefcfe3dbef95e6a16e.tar
identity-403a3234914fbfe4f215ecefcfe3dbef95e6a16e.tar.gz
identity-403a3234914fbfe4f215ecefcfe3dbef95e6a16e.tar.bz2
identity-403a3234914fbfe4f215ecefcfe3dbef95e6a16e.tar.xz
identity-403a3234914fbfe4f215ecefcfe3dbef95e6a16e.zip
let a user who is set as a owner of the group manage it
Diffstat (limited to 'lib/CatDap/Controller')
-rw-r--r--lib/CatDap/Controller/admin.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CatDap/Controller/admin.pm b/lib/CatDap/Controller/admin.pm
index e8771e6..495a6a1 100644
--- a/lib/CatDap/Controller/admin.pm
+++ b/lib/CatDap/Controller/admin.pm
@@ -632,7 +632,12 @@ sub group_modify : Local {
$c->detach('/admin/group');
}
- if ( ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) {
+ #FIXME I am sure that the code can be smaller and leaner
+ @entries = $mesg_group->entries;
+ @entries = $entries[0]->get_value('owner');
+ my $is_owner = grep { $_ eq $c->user->ldap_entry->dn } @entries;
+
+ if ( ! $is_owner and ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) {
$c->forward('/user');
}