Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 517-519 (lines=3) @@
514
		// If they're not an admin, check they are a subadmin of the group in question
515
		$loggedInUser = $this->userSession->getUser();
516
		$subAdminManager = $this->groupManager->getSubAdmin();
517
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
518
			throw new OCSException('', 104);
519
		}
520
521
		// Add user to group
522
		$group->addUser($targetUser);
@@ 554-556 (lines=3) @@
551
552
		// If they're not an admin, check they are a subadmin of the group in question
553
		$subAdminManager = $this->groupManager->getSubAdmin();
554
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
555
			throw new OCSException('', 104);
556
		}
557
558
		// Check they aren't removing themselves from 'admin' or their 'subadmin; group
559
		if ($userId === $loggedInUser->getUID()) {