RBAC: generated prefixed uids for external service role (#76601)

* Replace FixedRoleUID function with a common function to generate these prefixes

* Use common function to generate prefixed uid for external service accounts

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>

---------

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
This commit is contained in:
Karl Persson
2023-10-16 13:12:16 +02:00
committed by GitHub
parent bc98f3d139
commit ae5e03034b
4 changed files with 35 additions and 47 deletions

View File

@@ -319,22 +319,9 @@ func (cmd *SaveExternalServiceRoleCommand) Validate() error {
}
const (
GlobalOrgID = 0
FixedRolePrefix = "fixed:"
FixedRoleUIDPrefix = "fixed_"
ManagedRolePrefix = "managed:"
BasicRolePrefix = "basic:"
PluginRolePrefix = "plugins:"
ExternalServiceRolePrefix = "externalservice:"
BasicRoleUIDPrefix = "basic_"
ExternalServiceRoleUIDPrefix = "externalservice_"
RoleGrafanaAdmin = "Grafana Admin"
GlobalOrgID = 0
GeneralFolderUID = "general"
// Basic Role None
BasicRoleNoneUID = "basic_none"
BasicRoleNoneName = "basic:none"
RoleGrafanaAdmin = "Grafana Admin"
// Permission actions