(ctx context.Context)
| 33 | } |
| 34 | |
| 35 | func roleCache(ctx context.Context) *syncmap.Map[string, rbac.Role] { |
| 36 | c, ok := ctx.Value(customRoleCtxKey{}).(*syncmap.Map[string, rbac.Role]) |
| 37 | if !ok { |
| 38 | return syncmap.New[string, rbac.Role]() |
| 39 | } |
| 40 | return c |
| 41 | } |
| 42 | |
| 43 | // Expand will expand built in roles, and fetch custom roles from the database. |
| 44 | // If a custom role is defined, but does not exist, the role will be omitted on |