@@ -46,6 +46,14 @@ type ScopedPolicyRules struct {
4646
4747var objectVerbs = []string {"get" , "patch" , "update" , "delete" }
4848
49+ // Here we are splitting collection verbs based on required scope
50+ // NB: this split is tightly coupled to the requirements of the contentmanager, specifically
51+ // its need for cluster-scoped list/watch permissions.
52+ // TODO: We are accepting this coupling for now, but plan to decouple
53+ // TODO: link for above https://github.com/operator-framework/operator-controller/issues/1911
54+ var namespacedCollectionVerbs = []string {"create" }
55+ var clusterCollectionVerbs = []string {"list" , "watch" }
56+
4957type rbacPreAuthorizer struct {
5058 authorizer authorizer.Authorizer
5159 ruleResolver validation.AuthorizationRuleResolver
@@ -302,13 +310,6 @@ func (dm *decodedManifest) rbacObjects() []client.Object {
302310func (dm * decodedManifest ) asAuthorizationAttributesRecordsForUser (manifestManager user.Info , ext * ocv1.ClusterExtension ) []authorizer.AttributesRecord {
303311 var attributeRecords []authorizer.AttributesRecord
304312
305- // Here we are splitting collection verbs based on required scope
306- // NB: this split is tightly coupled to the requirements of the contentmanager, specifically
307- // its need for cluster-scoped list/watch permissions.
308- // TODO: We are accepting this coupling for now, but plan to decouple
309- namespacedCollectionVerbs := []string {"create" }
310- clusterCollectionVerbs := []string {"list" , "watch" }
311-
312313 for gvr , keys := range dm .gvrs {
313314 namespaces := sets .New [string ]()
314315 for _ , k := range keys {
0 commit comments