Code Duplication    Length = 3-3 lines in 2 locations

apps/provisioning_api/lib/Controller/UsersController.php 2 locations

@@ 709-711 (lines=3) @@
706
		// If they're not an admin, check they are a subadmin of the group in question
707
		$loggedInUser = $this->userSession->getUser();
708
		$subAdminManager = $this->groupManager->getSubAdmin();
709
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
710
			throw new OCSException('', 104);
711
		}
712
713
		// Add user to group
714
		$group->addUser($targetUser);
@@ 746-748 (lines=3) @@
743
744
		// If they're not an admin, check they are a subadmin of the group in question
745
		$subAdminManager = $this->groupManager->getSubAdmin();
746
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
747
			throw new OCSException('', 104);
748
		}
749
750
		// Check they aren't removing themselves from 'admin' or their 'subadmin; group
751
		if ($targetUser->getUID() === $loggedInUser->getUID()) {