Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 505-507 (lines=3) @@
502
		// If they're not an admin, check they are a subadmin of the group in question
503
		$loggedInUser = $this->userSession->getUser();
504
		$subAdminManager = $this->groupManager->getSubAdmin();
505
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
506
			throw new OCSException('', 104);
507
		}
508
509
		// Add user to group
510
		$group->addUser($targetUser);
@@ 542-544 (lines=3) @@
539
540
		// If they're not an admin, check they are a subadmin of the group in question
541
		$subAdminManager = $this->groupManager->getSubAdmin();
542
		if (!$this->groupManager->isAdmin($loggedInUser->getUID()) && !$subAdminManager->isSubAdminOfGroup($loggedInUser, $group)) {
543
			throw new OCSException('', 104);
544
		}
545
546
		// Check they aren't removing themselves from 'admin' or their 'subadmin; group
547
		if ($userId === $loggedInUser->getUID()) {