diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index c8882f7b00854..30094470a7aa0 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -773,7 +773,7 @@ public function removeFromGroup(string $userId, string $groupid): DataResponse { if (count($userSubAdminGroups) <= 1) { // Subadmin must not be able to remove a user from all their subadmin groups. - throw new OCSException('Cannot remove user from this group as this is the only remaining group you are a SubAdmin of', 105); + throw new OCSException('Not viable to remove user from the last group you are SubAdmin of', 105); } } diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 7b235a1d5abee..7772000d51ce7 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -2516,7 +2516,7 @@ public function testRemoveFromGroupAsSubAdminFromSubAdmin() { /** * @expectedException \OCP\AppFramework\OCS\OCSException * @expectedExceptionCode 105 - * @expectedExceptionMessage Cannot remove user from this group as this is the only remaining group you are a SubAdmin of + * @expectedExceptionMessage Not viable to remove user from the last group you are SubAdmin of */ public function testRemoveFromGroupAsSubAdminFromLastSubAdminGroup() { $loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();