mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
bitbake: hashserv: Allow self-service deletion
Allows users to self-service deletion of their own user accounts (meaning, they can delete their own accounts without special permissions). (Bitbake rev: 2d4439948a5328a9768bca9eaec221eb82af3cb2) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
1699870a0c
commit
33cde47e10
|
@ -709,7 +709,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
|
|||
"token": token,
|
||||
}
|
||||
|
||||
@permissions(USER_ADMIN_PERM, allow_anon=False)
|
||||
@permissions(USER_ADMIN_PERM, allow_self_service=True, allow_anon=False)
|
||||
async def handle_delete_user(self, request):
|
||||
username = str(request["username"])
|
||||
|
||||
|
|
|
@ -683,10 +683,13 @@ class HashEquivalenceCommonTests(object):
|
|||
|
||||
user = self.create_user("test-user", [])
|
||||
|
||||
# No self service
|
||||
with self.auth_client(user) as client, self.assertRaises(InvokeError):
|
||||
# self service
|
||||
with self.auth_client(user) as client:
|
||||
client.delete_user(user["username"])
|
||||
|
||||
self.assertIsNone(admin_client.get_user(user["username"]))
|
||||
user = self.create_user("test-user", [])
|
||||
|
||||
with self.auth_perms() as client, self.assertRaises(InvokeError):
|
||||
client.delete_user(user["username"])
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user