Skip to content

Commit

Permalink
tests: authz update project roles
Browse files Browse the repository at this point in the history
  • Loading branch information
adilansari committed Jun 22, 2023
1 parent 97f7b45 commit 44afc7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/middleware/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestAuthzOwnerRole(t *testing.T) {
require.True(t, isAuthorizedOperation(api.CreateOrUpdateCollectionsMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.DropCollectionMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.ListProjectsMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.UpdateProjectMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.ListCollectionsMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.CreateProjectMethodName, auth.OwnerRoleName))
require.True(t, isAuthorizedOperation(api.DeleteProjectMethodName, auth.OwnerRoleName))
Expand Down Expand Up @@ -149,6 +150,7 @@ func TestAuthzEditorRole(t *testing.T) {
require.True(t, isAuthorizedOperation(api.ListProjectsMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.ListCollectionsMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.CreateProjectMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.UpdateProjectMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.DeleteProjectMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.DescribeDatabaseMethodName, auth.EditorRoleName))
require.True(t, isAuthorizedOperation(api.DescribeCollectionMethodName, auth.EditorRoleName))
Expand Down Expand Up @@ -285,6 +287,7 @@ func TestAuthzReadOnlyRole(t *testing.T) {
require.False(t, isAuthorizedOperation(api.UpdateMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.DeleteMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.CreateProjectMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.UpdateProjectMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.CreateOrUpdateCollectionMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.CreateOrUpdateCollectionsMethodName, auth.ReadOnlyRoleName))
require.False(t, isAuthorizedOperation(api.DeleteProjectMethodName, auth.ReadOnlyRoleName))
Expand Down

0 comments on commit 44afc7e

Please sign in to comment.