Code Duplication    Length = 3-3 lines in 2 locations

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

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