From 31b1a73e1f508a33843835b632ee05c7bfc2aaaf Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 14 Jan 2013 19:45:17 +0100 Subject: Check if user is admin - bool There was no "isAdminUser()" function which returned bool. This is irritiating as there were a loooooooot of places in the code which checked this itself with `OC_Group::inGroup($uid, 'admin)` - why not use a function for this? (Especially if you consider that we might change the group name in the future, which would lead to problems then) Additionally, @Raydiation needed such a method for his AppFramework :) --- lib/api.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/api.php') diff --git a/lib/api.php b/lib/api.php index cb67e0c2a89..c464cd04913 100644 --- a/lib/api.php +++ b/lib/api.php @@ -127,8 +127,7 @@ class OC_API { return false; } else { $subAdmin = OC_SubAdmin::isSubAdmin($user); - $admin = OC_Group::inGroup($user, 'admin'); - if($subAdmin || $admin) { + if($subAdmin) { return true; } else { return false; @@ -141,7 +140,7 @@ class OC_API { if(!$user) { return false; } else { - return OC_Group::inGroup($user, 'admin'); + return OC_User::isAdminUser($user); } break; default: -- cgit v1.2.3