diff options
-rw-r--r-- | bitbake/lib/hashserv/server.py | 2 | ||||
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/hashserv/server.py b/bitbake/lib/hashserv/server.py index 8c3d20b651..439962f782 100644 --- a/bitbake/lib/hashserv/server.py +++ b/bitbake/lib/hashserv/server.py | |||
@@ -709,7 +709,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection): | |||
709 | "token": token, | 709 | "token": token, |
710 | } | 710 | } |
711 | 711 | ||
712 | @permissions(USER_ADMIN_PERM, allow_anon=False) | 712 | @permissions(USER_ADMIN_PERM, allow_self_service=True, allow_anon=False) |
713 | async def handle_delete_user(self, request): | 713 | async def handle_delete_user(self, request): |
714 | username = str(request["username"]) | 714 | username = str(request["username"]) |
715 | 715 | ||
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index 5d209ffb87..f0be867915 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -683,10 +683,13 @@ class HashEquivalenceCommonTests(object): | |||
683 | 683 | ||
684 | user = self.create_user("test-user", []) | 684 | user = self.create_user("test-user", []) |
685 | 685 | ||
686 | # No self service | 686 | # self service |
687 | with self.auth_client(user) as client, self.assertRaises(InvokeError): | 687 | with self.auth_client(user) as client: |
688 | client.delete_user(user["username"]) | 688 | client.delete_user(user["username"]) |
689 | 689 | ||
690 | self.assertIsNone(admin_client.get_user(user["username"])) | ||
691 | user = self.create_user("test-user", []) | ||
692 | |||
690 | with self.auth_perms() as client, self.assertRaises(InvokeError): | 693 | with self.auth_perms() as client, self.assertRaises(InvokeError): |
691 | client.delete_user(user["username"]) | 694 | client.delete_user(user["username"]) |
692 | 695 | ||