Skip to content

Commit

Permalink
Allow registry-admin to manage RBAC roles/bindings
Browse files Browse the repository at this point in the history
registry-admin can already manage these resources via the proxied
origin authorization endpoints.  This just allows it to perform
these actions directly.

Signed-off-by: Monis Khan <[email protected]>
  • Loading branch information
enj committed Nov 9, 2017
1 parent 0bee69f commit 6fe9944
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/server/bootstrappolicy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ func GetOpenshiftBootstrapClusterRoles() []rbac.ClusterRole {
rbac.NewRule("create").Groups(imageGroup, legacyImageGroup).Resources("imagestreamimports").RuleOrDie(),
rbac.NewRule("get", "update").Groups(imageGroup, legacyImageGroup).Resources("imagestreams/layers").RuleOrDie(),
rbac.NewRule(readWrite...).Groups(authzGroup, legacyAuthzGroup).Resources("rolebindings", "roles").RuleOrDie(),
rbac.NewRule(readWrite...).Groups(rbacGroup).Resources("roles", "rolebindings").RuleOrDie(),
rbac.NewRule("create").Groups(authzGroup, legacyAuthzGroup).Resources("localresourceaccessreviews", "localsubjectaccessreviews", "subjectrulesreviews").RuleOrDie(),
rbac.NewRule("create").Groups(kAuthzGroup).Resources("localsubjectaccessreviews").RuleOrDie(),

Expand Down
14 changes: 14 additions & 0 deletions test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2560,6 +2560,20 @@ items:
- patch
- update
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- authorization.openshift.io
Expand Down
15 changes: 15 additions & 0 deletions test/testdata/bootstrappolicy/bootstrap_policy_file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2800,6 +2800,21 @@ items:
- patch
- update
- watch
- apiGroups:
- rbac.authorization.k8s.io
attributeRestrictions: null
resources:
- rolebindings
- roles
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
- authorization.openshift.io
Expand Down

0 comments on commit 6fe9944

Please sign in to comment.