From 9a07fae2c3023db51f8667c2c9184ac47bb89e1c Mon Sep 17 00:00:00 2001 From: benoit74 Date: Mon, 16 Dec 2024 12:57:49 +0000 Subject: [PATCH] Add new role for external testers of the Zimfarm --- dispatcher/backend/src/common/roles.py | 4 ++++ dispatcher/frontend-ui/src/constants.js | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dispatcher/backend/src/common/roles.py b/dispatcher/backend/src/common/roles.py index 23ee135bc..5c801afea 100644 --- a/dispatcher/backend/src/common/roles.py +++ b/dispatcher/backend/src/common/roles.py @@ -41,6 +41,10 @@ class ZimPermissions(Permissions): ), }, "editor": {"schedules": SchedulePermissions.get(create=True, update=True)}, + "editor-requester": { + "tasks": TaskPermissions.get(request=True, unrequest=True, cancel=True), + "schedules": SchedulePermissions.get(create=True, update=True), + }, "worker": { "tasks": TaskPermissions.get(create=True, update=True, cancel=True), "zim": ZimPermissions.get(upload=True), diff --git a/dispatcher/frontend-ui/src/constants.js b/dispatcher/frontend-ui/src/constants.js index e9c5af2ed..903f0d7fd 100644 --- a/dispatcher/frontend-ui/src/constants.js +++ b/dispatcher/frontend-ui/src/constants.js @@ -365,7 +365,14 @@ export default { ALERT_DEFAULT_DURATION: 5, ALERT_LONG_DURATION: 10, ALERT_PERMANENT_DURATION: true, - ROLES: ["editor", "manager", "admin", "worker", "processor"], + ROLES: [ + "editor", + "editor-requester", + "manager", + "admin", + "worker", + "processor", + ], TOKEN_COOKIE_EXPIRY: "180D", // 6 months COOKIE_LIFETIME_EXPIRY: "10Y", // 10 years TOKEN_COOKIE_NAME: "auth",