Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 579-581 (lines=3) @@
576
		// If they're not an admin, check they are a subadmin of the group in question
577
		$loggedInUser = $this->userSession->getUser();
578
		$subAdminManager = $this->groupManager->getSubAdmin();
579
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
580
			throw new OCSException('', 104);
581
		}
582
583
		// Add user to group
584
		$group->addUser($targetUser);
@@ 616-618 (lines=3) @@
613
614
		// If they're not an admin, check they are a subadmin of the group in question
615
		$subAdminManager = $this->groupManager->getSubAdmin();
616
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
617
			throw new OCSException('', 104);
618
		}
619
620
		// Check they aren't removing themselves from 'admin' or their 'subadmin; group
621
		if ($userId === $loggedInUser->getUID()) {