From 7ae2d8714a5fd11155ee3974c1b7cd1be20ac56d Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sat, 5 Feb 2022 18:32:06 +0400 Subject: Add Role Based Editors To Forms Adds the ability to specify who can edit forms using discord roles. Signed-off-by: Hassan Abouelela --- backend/discord.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backend/discord.py') diff --git a/backend/discord.py b/backend/discord.py index 4e35216..6c8eefe 100644 --- a/backend/discord.py +++ b/backend/discord.py @@ -188,3 +188,8 @@ async def _verify_access_helper( async def verify_response_access(form_id: str, request: starlette.requests.Request) -> bool: """Ensure the user can access responses on the requested resource.""" return await _verify_access_helper(form_id, request, "response_readers") + + +async def verify_edit_access(form_id: str, request: starlette.requests.Request) -> bool: + """Ensure the user can view and modify the requested resource.""" + return await _verify_access_helper(form_id, request, "editors") -- cgit v1.2.3