diff options
Diffstat (limited to 'lib/private/group')
-rw-r--r-- | lib/private/group/group.php | 5 | ||||
-rw-r--r-- | lib/private/group/metadata.php | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/group/group.php b/lib/private/group/group.php index 6111051ea09..5f439e91cde 100644 --- a/lib/private/group/group.php +++ b/lib/private/group/group.php @@ -229,6 +229,11 @@ class Group implements IGroup { * @return bool */ public function delete() { + // Prevent users from deleting group admin + if ($this->getGID() === 'admin') { + return false; + } + $result = false; if ($this->emitter) { $this->emitter->emit('\OC\Group', 'preDelete', array($this)); diff --git a/lib/private/group/metadata.php b/lib/private/group/metadata.php index 687a735347c..c702c924ff7 100644 --- a/lib/private/group/metadata.php +++ b/lib/private/group/metadata.php @@ -29,7 +29,7 @@ class MetaData { protected $metaData = array(); /** - * @var \OC\Group\Manager $groupManager + * @var \OCP\IGroupManager $groupManager */ protected $groupManager; @@ -41,12 +41,12 @@ class MetaData { /** * @param string $user the uid of the current user * @param bool $isAdmin whether the current users is an admin - * @param \OC\Group\Manager $groupManager + * @param \OCP\IGroupManager $groupManager */ public function __construct( $user, $isAdmin, - \OC\Group\Manager $groupManager + \OCP\IGroupManager $groupManager ) { $this->user = $user; $this->isAdmin = (bool)$isAdmin; @@ -168,6 +168,7 @@ class MetaData { if($this->isAdmin) { return $this->groupManager->search($search); } else { + // FIXME: Remove static method call $groupIds = \OC_SubAdmin::getSubAdminsGroups($this->user); /* \OC_SubAdmin::getSubAdminsGroups() returns an array of GIDs, but this |