File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,7 @@ func RoleToRBAC(role codersdk.Role) rbac.Role {
553
553
User : List (role .UserPermissions , PermissionToRBAC ),
554
554
}
555
555
}
556
+
556
557
func PermissionToRBAC (permission codersdk.Permission ) rbac.Permission {
557
558
return rbac.Permission {
558
559
Negate : permission .Negate ,
Original file line number Diff line number Diff line change @@ -1213,7 +1213,8 @@ func (s *MethodTestSuite) TestUser() {
1213
1213
OrgPermissions : must (json .Marshal (map [string ][]rbac.Permission {
1214
1214
orgID .String (): rbac .Permissions (map [string ][]policy.Action {
1215
1215
rbac .ResourceTemplate .Type : {policy .ActionCreate , policy .ActionRead },
1216
- })})),
1216
+ }),
1217
+ })),
1217
1218
UserPermissions : must (json .Marshal (rbac .Permissions (map [string ][]policy.Action {
1218
1219
rbac .ResourceWorkspace .Type : {policy .ActionRead },
1219
1220
}))),
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ func (names RoleNames) Names() []string {
54
54
// site and orgs, and these functions can be removed.
55
55
56
56
func CustomSiteRole () string { return roleName (customSiteRole , "" ) }
57
+
57
58
func RoleOwner () string {
58
59
return roleName (owner , "" )
59
60
}
Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ import (
11
11
"github.com/coder/coder/v2/coderd/rbac"
12
12
)
13
13
14
- type customRoleCtxKey struct {}
15
- type customRoleCache map [string ]rbac.Role
14
+ type (
15
+ customRoleCtxKey struct {}
16
+ customRoleCache map [string ]rbac.Role
17
+ )
16
18
17
19
func CustomRoleMW (next http.Handler ) http.Handler {
18
20
return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments