Skip to content

Commit

Permalink
Ensure admin cannot unassign SAML group members
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Treffler <[email protected]>
Co-authored-by: Giuliano Mele <[email protected]>
  • Loading branch information
melegiul and JonathanTreffler committed Aug 20, 2021
1 parent bbdb3b5 commit f29f3ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
use OCP\Group\Backend\ABackend;
use OCP\Group\Backend\IAddToGroupBackend;
use OCP\Group\Backend\ICountUsersBackend;
use OCP\Group\Backend\ICreateGroupBackend;
use OCP\Group\Backend\IDeleteGroupBackend;
use OCP\Group\Backend\IRemoveFromGroupBackend;
use OCP\IDBConnection;

class GroupBackend extends ABackend implements IAddToGroupBackend, IRemoveFromGroupBackend, ICountUsersBackend {
class GroupBackend extends ABackend implements IAddToGroupBackend, ICountUsersBackend {
/** @var IDBConnection */
private $dbc;

Expand Down
2 changes: 1 addition & 1 deletion lib/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function removeGroup(IUser $user, string $gid) {
if($group === null) {
return;
}
$group->removeUser($user);
$this->ownGroupBackend->removeFromGroup($user->getUID(), $group->getGID());
if ($this->ownGroupBackend->countUsersInGroup($gid) === 0) {
$this->ownGroupBackend->deleteGroup($group->getGID());
}
Expand Down

0 comments on commit f29f3ce

Please sign in to comment.