fix(influxdb): special case the orgs resource when generating permissions
parent
00711c5c01
commit
ffdba45242
8
authz.go
8
authz.go
|
@ -296,6 +296,10 @@ func OwnerPermissions(orgID ID) []Permission {
|
|||
ps := []Permission{}
|
||||
for _, r := range AllResourceTypes {
|
||||
for _, a := range actions {
|
||||
if r == OrgsResourceType {
|
||||
ps = append(ps, Permission{Action: a, Resource: Resource{Type: r, ID: &orgID}})
|
||||
continue
|
||||
}
|
||||
ps = append(ps, Permission{Action: a, Resource: Resource{Type: r, OrgID: &orgID}})
|
||||
}
|
||||
}
|
||||
|
@ -307,6 +311,10 @@ func OwnerPermissions(orgID ID) []Permission {
|
|||
func MemberPermissions(orgID ID) []Permission {
|
||||
ps := []Permission{}
|
||||
for _, r := range AllResourceTypes {
|
||||
if r == OrgsResourceType {
|
||||
ps = append(ps, Permission{Action: ReadAction, Resource: Resource{Type: r, ID: &orgID}})
|
||||
continue
|
||||
}
|
||||
ps = append(ps, Permission{Action: ReadAction, Resource: Resource{Type: r, OrgID: &orgID}})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue