From b9139c2356f75103bc5fd17f074f4ee0e74b64aa Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 23 Jan 2023 14:30:20 +0300 Subject: auth: create group: Fix group creation. * gn3/auth/authorisation/checks.py: Enable passing user to authorisation checking function. Raise error on authorisation failure for consistent error handling. * gn3/auth/authorisation/groups.py: Add user to group, updating the privileges as appropriate. * gn3/auth/authorisation/resources.py: Fix resources querying * gn3/auth/authorisation/roles.py: Assign/revoke roles by name * gn3/auth/authorisation/views.py: Create group * migrations/auth/20221108_01_CoxYh-create-the-groups-table.py: Add group_metadata field * tests/unit/auth/fixtures/group_fixtures.py: fix tests * tests/unit/auth/test_groups.py: fix tests * tests/unit/auth/test_resources.py: fix tests * tests/unit/auth/test_roles.py: fix tests --- migrations/auth/20221108_01_CoxYh-create-the-groups-table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'migrations') diff --git a/migrations/auth/20221108_01_CoxYh-create-the-groups-table.py b/migrations/auth/20221108_01_CoxYh-create-the-groups-table.py index 06491dd..29f92d4 100644 --- a/migrations/auth/20221108_01_CoxYh-create-the-groups-table.py +++ b/migrations/auth/20221108_01_CoxYh-create-the-groups-table.py @@ -11,7 +11,8 @@ steps = [ """ CREATE TABLE IF NOT EXISTS groups( group_id TEXT PRIMARY KEY NOT NULL, - group_name TEXT NOT NULL + group_name TEXT NOT NULL, + group_metadata TEXT ) WITHOUT ROWID """, "DROP TABLE IF EXISTS groups") -- cgit v1.2.3