Auth: setup a public rule
This commit is contained in:
parent
f64b1468a5
commit
4d2de923cd
@ -203,7 +203,13 @@ var ruleJoinKey = ":"
|
|||||||
// accessForRule returns a rule status, indicating if a rule permits access to a
|
// accessForRule returns a rule status, indicating if a rule permits access to a
|
||||||
// resource for a given account
|
// resource for a given account
|
||||||
func accessForRule(rule *pb.Rule, acc *auth.Account, res *auth.Resource) pb.Access {
|
func accessForRule(rule *pb.Rule, acc *auth.Account, res *auth.Resource) pb.Access {
|
||||||
if rule.Role == "*" {
|
// a blank role permits access to the public
|
||||||
|
if rule.Role == "" {
|
||||||
|
return rule.Access
|
||||||
|
}
|
||||||
|
|
||||||
|
// a * role permits access to any user
|
||||||
|
if rule.Role == "*" && acc != nil {
|
||||||
return rule.Access
|
return rule.Access
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user