File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
main/kotlin/com/cosmotech/api/rbac
test/kotlin/com/cosmotech/api/rbac Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ const val PERMISSION_DELETE = "delete"
2222const val PERMISSION_LAUNCH = " launch"
2323const val PERMISSION_VALIDATE = " validate"
2424
25+ val NO_PERMISSIONS = emptyList<String >()
26+
2527val COMMON_ROLE_READER_PERMISSIONS = listOf (PERMISSION_READ )
2628val COMMON_ROLE_USER_PERMISSIONS =
2729 listOf (PERMISSION_READ , PERMISSION_READ_SECURITY , PERMISSION_CREATE_CHILDREN )
@@ -92,6 +94,7 @@ fun getCommonRolesDefinition(): RolesDefinition {
9294 return RolesDefinition (
9395 permissions =
9496 mutableMapOf (
97+ ROLE_NONE to NO_PERMISSIONS ,
9598 ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
9699 ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
97100 ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
@@ -104,6 +107,7 @@ fun getScenarioRolesDefinition(): RolesDefinition {
104107 return RolesDefinition (
105108 permissions =
106109 mutableMapOf (
110+ ROLE_NONE to NO_PERMISSIONS ,
107111 ROLE_VIEWER to SCENARIO_ROLE_VIEWER_PERMISSIONS ,
108112 ROLE_EDITOR to SCENARIO_ROLE_EDITOR_PERMISSIONS ,
109113 ROLE_VALIDATOR to SCENARIO_ROLE_VALIDATOR_PERMISSIONS ,
Original file line number Diff line number Diff line change @@ -634,6 +634,7 @@ class CsmRbacTests {
634634 fun `get default role definition permissions` () {
635635 val expected: MutableMap <String , List <String >> =
636636 mutableMapOf (
637+ ROLE_NONE to NO_PERMISSIONS ,
637638 ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
638639 ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
639640 ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
@@ -655,6 +656,7 @@ class CsmRbacTests {
655656 definition.permissions.put(customRole, customRolePermissions)
656657 val expected: MutableMap <String , List <String >> =
657658 mutableMapOf (
659+ ROLE_NONE to NO_PERMISSIONS ,
658660 ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
659661 ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
660662 ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
You can’t perform that action at this time.
0 commit comments