mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Auth: Add None role to Viewer case (#96624)
Add None role to Viewer case
This commit is contained in:
parent
3fa8df6b62
commit
8b7100a9aa
@ -37,15 +37,13 @@ func (auth orgRoleAuthorizer) Authorize(ctx context.Context, a authorizer.Attrib
|
||||
default:
|
||||
return authorizer.DecisionDeny, errorMessageForGrafanaOrgRole(orgRole, a), nil
|
||||
}
|
||||
case org.RoleViewer:
|
||||
case org.RoleViewer, org.RoleNone:
|
||||
switch a.GetVerb() {
|
||||
case "get", "list", "watch":
|
||||
return authorizer.DecisionAllow, "", nil
|
||||
default:
|
||||
return authorizer.DecisionDeny, errorMessageForGrafanaOrgRole(orgRole, a), nil
|
||||
}
|
||||
case org.RoleNone:
|
||||
return authorizer.DecisionDeny, errorMessageForGrafanaOrgRole(orgRole, a), nil
|
||||
}
|
||||
return authorizer.DecisionDeny, "", nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user