diff options
-rw-r--r-- | gn3/auth/authorisation/resources.py | 7 | ||||
-rw-r--r-- | tests/unit/auth/test_groups.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/gn3/auth/authorisation/resources.py b/gn3/auth/authorisation/resources.py index 2ddd865..095a72c 100644 --- a/gn3/auth/authorisation/resources.py +++ b/gn3/auth/authorisation/resources.py @@ -34,12 +34,13 @@ def create_resource( if not group: raise MissingGroupError( "User with no group cannot create a resource.") - resource = Resource(group, uuid4(), resource_name, resource_category) + resource = Resource(group, uuid4(), resource_name, resource_category, False) cursor.execute( - ("INSERT INTO resources VALUES (?, ?, ?, ?)"), + "INSERT INTO resources VALUES (?, ?, ?, ?, ?)", (str(resource.group.group_id), str(resource.resource_id), resource_name, - str(resource.resource_category.resource_category_id))) + str(resource.resource_category.resource_category_id), + 1 if resource.public else 0)) return resource diff --git a/tests/unit/auth/test_groups.py b/tests/unit/auth/test_groups.py index 79dc16f..9eef0e9 100644 --- a/tests/unit/auth/test_groups.py +++ b/tests/unit/auth/test_groups.py @@ -115,5 +115,5 @@ def test_user_group(test_users_in_group, user, expected): THEN: return a Maybe containing the group that the user belongs to, or Nothing """ - conn, group, users = test_users_in_group + conn, _group, _users = test_users_in_group assert user_group(conn, user).maybe(Nothing, lambda val: val) == expected |