From e8b6b4e99f7a4ea649dab0c5a7bf7695531e97d2 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 22 Oct 2021 18:52:39 +0000 Subject: Include the admin privilege for the 'editors' group, since it wasn't being set before (which caused some problems) --- scripts/authentication/resource.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/authentication/resource.py') diff --git a/scripts/authentication/resource.py b/scripts/authentication/resource.py index 4996f34c..1a2bcd8a 100644 --- a/scripts/authentication/resource.py +++ b/scripts/authentication/resource.py @@ -97,7 +97,8 @@ if __name__ == "__main__": for resource_id, resource in RESOURCES.items(): _resource = json.loads(resource) # str -> dict conversion _resource["group_masks"] = {args.group_id: {"metadata": "edit", - "data": "edit"}} + "data": "edit", + "admin": "edit-admins"}} REDIS_CONN.hset("resources", resource_id, json.dumps(_resource)) -- cgit v1.2.3 From 5d6559cdc0f9251a90b351bf440b930a000f8354 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 19 Oct 2021 16:17:32 +0300 Subject: scripts: resource.py: Add shebang --- scripts/authentication/resource.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 scripts/authentication/resource.py (limited to 'scripts/authentication/resource.py') diff --git a/scripts/authentication/resource.py b/scripts/authentication/resource.py old mode 100644 new mode 100755 index 1a2bcd8a..1f5f31d8 --- a/scripts/authentication/resource.py +++ b/scripts/authentication/resource.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """A script that: - Optionally restores data from a json file. -- cgit v1.2.3 From 182327254fe2964c3dd41aabe49ab99748800a64 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 19 Oct 2021 16:47:38 +0300 Subject: scripts: resource: Add value for "admin" when updating resources --- scripts/authentication/resource.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts/authentication/resource.py') diff --git a/scripts/authentication/resource.py b/scripts/authentication/resource.py index 1f5f31d8..4b8d801a 100755 --- a/scripts/authentication/resource.py +++ b/scripts/authentication/resource.py @@ -38,14 +38,14 @@ from datetime import datetime def recover_hash(name: str, file_path: str, set_function) -> bool: """Recover back-ups using the `set_function` - Parameters: + Args: + - name: Redis hash where `file_path` will be restored + - file_path: File path where redis hash is sourced from + - set_function: Function used to do the Redis backup for + example: HSET - - `name`: Redis hash where `file_path` will be restored - - - `file_path`: File path where redis hash is sourced from - - - `set_function`: Function used to do the Redis backup for - example: HSET + Returns: + A boolean indicating whether the function ran successfully. """ try: @@ -99,7 +99,7 @@ if __name__ == "__main__": _resource = json.loads(resource) # str -> dict conversion _resource["group_masks"] = {args.group_id: {"metadata": "edit", "data": "edit", - "admin": "edit-admins"}} + "admin": "not-admin"}} REDIS_CONN.hset("resources", resource_id, json.dumps(_resource)) -- cgit v1.2.3