File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
main/kotlin/com/cosmotech/common/rbac
test/kotlin/com/cosmotech/common/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"
22
22
const val PERMISSION_LAUNCH = " launch"
23
23
const val PERMISSION_VALIDATE = " validate"
24
24
25
+ val NO_PERMISSIONS = emptyList<String >()
26
+
25
27
val COMMON_ROLE_READER_PERMISSIONS = listOf (PERMISSION_READ )
26
28
val COMMON_ROLE_USER_PERMISSIONS =
27
29
listOf (PERMISSION_READ , PERMISSION_READ_SECURITY , PERMISSION_CREATE_CHILDREN )
@@ -92,6 +94,7 @@ fun getCommonRolesDefinition(): RolesDefinition {
92
94
return RolesDefinition (
93
95
permissions =
94
96
mutableMapOf (
97
+ ROLE_NONE to NO_PERMISSIONS ,
95
98
ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
96
99
ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
97
100
ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
@@ -104,6 +107,7 @@ fun getRunnerRolesDefinition(): RolesDefinition {
104
107
return RolesDefinition (
105
108
permissions =
106
109
mutableMapOf (
110
+ ROLE_NONE to NO_PERMISSIONS ,
107
111
ROLE_VIEWER to RUNNER_ROLE_VIEWER_PERMISSIONS ,
108
112
ROLE_EDITOR to RUNNER_ROLE_EDITOR_PERMISSIONS ,
109
113
ROLE_VALIDATOR to RUNNER_ROLE_VALIDATOR_PERMISSIONS ,
Original file line number Diff line number Diff line change @@ -639,6 +639,7 @@ class CsmRbacTests {
639
639
fun `get default role definition permissions` () {
640
640
val expected: MutableMap <String , List <String >> =
641
641
mutableMapOf (
642
+ ROLE_NONE to NO_PERMISSIONS ,
642
643
ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
643
644
ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
644
645
ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
@@ -660,6 +661,7 @@ class CsmRbacTests {
660
661
definition.permissions.put(customRole, customRolePermissions)
661
662
val expected: MutableMap <String , List <String >> =
662
663
mutableMapOf (
664
+ ROLE_NONE to NO_PERMISSIONS ,
663
665
ROLE_VIEWER to COMMON_ROLE_READER_PERMISSIONS ,
664
666
ROLE_USER to COMMON_ROLE_USER_PERMISSIONS ,
665
667
ROLE_EDITOR to COMMON_ROLE_EDITOR_PERMISSIONS ,
You can’t perform that action at this time.
0 commit comments