RBAC: add check for whether a role is managed (#55617)

* add check for whether a role is managed

* fix typo
This commit is contained in:
Ieva 2022-09-22 15:00:42 +01:00 committed by GitHub
parent cf588bd083
commit 6f93630e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,10 @@ func (r *RoleDTO) Global() bool {
return r.OrgID == GlobalOrgID
}
func (r *RoleDTO) IsManaged() bool {
return strings.HasPrefix(r.Name, ManagedRolePrefix)
}
func (r *RoleDTO) IsFixed() bool {
return strings.HasPrefix(r.Name, FixedRolePrefix)
}