@@ -360,6 +360,67 @@ async def check_sqs(self, sqs_key=None, sqs_secret=None, sqs_url=None):
360360 data = {"sqs_key" : sqs_key , "sqs_secret" : sqs_secret , "sqs_url" : sqs_url }
361361 return await self .post ("check_sqs" , data = data )
362362
363+ async def get_permission (self , name ):
364+ """
365+ Get the definition for a permission
366+
367+ :param name: Name of the permission
368+ """
369+ return await self .get (f"custom_permission/{ name } " )
370+
371+ async def create_permission (self , permission ):
372+ """
373+ Create a custom permission
374+
375+ :param permission: Definition of the permission
376+ """
377+ return await self .post ("custom_permission" , data = permission )
378+
379+ async def update_permission (self , name , permission ):
380+ """
381+ Update a custom permission
382+
383+ :param name: Name of the permission
384+ :param permission: New definition of the permission
385+ """
386+ return await self .post (f"custom_permission/{ name } " , data = permission )
387+
388+ async def delete_permission (self , name ):
389+ """
390+ Delete a custom permission
391+
392+ :param name: Name of the permission
393+ """
394+ return await self .delete (f"custom_permission/{ name } " )
395+
396+ async def list_permissions (self ):
397+ """
398+ List custom permissions of the app
399+ """
400+ return await self .get ("custom_permission" )
401+
402+ async def create_role (self , name ):
403+ """
404+ Create a custom role
405+
406+ :param name: Name of the role
407+ """
408+ return await self .post ("custom_role" , data = {"name" : name })
409+
410+ async def delete_role (self , name ):
411+ """
412+ Delete a custom role
413+
414+ :param name: Name of the role
415+ """
416+ return await self .delete (f"custom_role/{ name } " )
417+
418+ async def list_roles (self ):
419+ """
420+ List custom roles of the app
421+ """
422+ return await self .get ("custom_role" )
423+
363424 async def close (self ):
364425 await self .session .close ()
365426
0 commit comments