summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-07-19 16:30:58 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-07-19 16:30:58 +0200
commit6e139f16e4a245fb77d97d495fd8f1ce991a733b (patch)
treede5ed5a78f34b797df926a1d8aeafac6d37ce2e8
parentfb6468936e2b65d7d14f6b86ff3933f6fe0a6cc4 (diff)
downloadnextcloud-server-6e139f16e4a245fb77d97d495fd8f1ce991a733b.tar.gz
nextcloud-server-6e139f16e4a245fb77d97d495fd8f1ce991a733b.zip
add isUserAccessible method to OC_SubAdmin class
-rw-r--r--lib/subadmin.php13
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;
+ }
}