RBAC: FIX Allow specifying several valid scopes for a kind (#93176)
* PermRegistry: Fix regression with actions applying to multiple scopes * Add tests Co-authored-by: Ieva <ieva.vasiljeva@grafana.com> --------- Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
@@ -128,11 +128,9 @@ func (pr *permissionRegistry) RegisterPluginScope(scope string) {
|
||||
}
|
||||
|
||||
func (pr *permissionRegistry) RegisterPermission(action, scope string) error {
|
||||
if _, ok := pr.actionScopePrefixes[action]; ok {
|
||||
// action already registered
|
||||
return nil
|
||||
if _, ok := pr.actionScopePrefixes[action]; !ok {
|
||||
pr.actionScopePrefixes[action] = PrefixSet{}
|
||||
}
|
||||
pr.actionScopePrefixes[action] = PrefixSet{}
|
||||
|
||||
if scope == "" {
|
||||
// scopeless action
|
||||
|
||||
Reference in New Issue
Block a user