mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: Add org ID and role authorizers (#75701)
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
|
||||
func OrgIDFrom(ctx context.Context) (int64, bool) {
|
||||
ns := request.NamespaceValue(ctx)
|
||||
return ParseOrgID(ns)
|
||||
}
|
||||
|
||||
func ParseOrgID(ns string) (int64, bool) {
|
||||
if len(ns) < 5 || ns[:4] != "org-" {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user