diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-07-19 16:30:58 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-07-19 16:30:58 +0200 |
commit | 6e139f16e4a245fb77d97d495fd8f1ce991a733b (patch) | |
tree | de5ed5a78f34b797df926a1d8aeafac6d37ce2e8 | |
parent | fb6468936e2b65d7d14f6b86ff3933f6fe0a6cc4 (diff) | |
download | nextcloud-server-6e139f16e4a245fb77d97d495fd8f1ce991a733b.tar.gz nextcloud-server-6e139f16e4a245fb77d97d495fd8f1ce991a733b.zip |
add isUserAccessible method to OC_SubAdmin class
-rw-r--r-- | lib/subadmin.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/subadmin.php b/lib/subadmin.php index b6f0b3007fd..330876536d7 100644 --- a/lib/subadmin.php +++ b/lib/subadmin.php @@ -122,4 +122,17 @@ class OC_SubAdmin{ } return false; } + + public static function isUserAccessible($subadmin, $user){ + if(!self::isSubAdmin($subadmin)){ + return false; + } + $accessiblegroups = self::getSubAdminsGroups($subadmin); + foreach($accessiblegroups as $accessiblegroup){ + if(OC_Group::inGroup($user, $accessiblegroup)){ + return true; + } + } + return false; + } } |