Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 673-675 (lines=3) @@
670
		// If they're not an admin, check they are a subadmin of the group in question
671
		$loggedInUser = $this->userSession->getUser();
672
		$subAdminManager = $this->groupManager->getSubAdmin();
673
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
674
			throw new OCSException('', 104);
675
		}
676
677
		// Add user to group
678
		$group->addUser($targetUser);
@@ 710-712 (lines=3) @@
707
708
		// If they're not an admin, check they are a subadmin of the group in question
709
		$subAdminManager = $this->groupManager->getSubAdmin();
710
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
711
			throw new OCSException('', 104);
712
		}
713
714
		// Check they aren't removing themselves from 'admin' or their 'subadmin; group
715
		if ($targetUser->getUID() === $loggedInUser->getUID()) {