consul: use anonymous function for acl filtering

pull/1024/head
Ryan Uber 2015-06-10 18:43:48 -07:00
parent 5fed1b5dc3
commit 5b90b0f249
1 changed files with 0 additions and 17 deletions

View File

@ -193,23 +193,6 @@ func (s *Server) useACLPolicy(id, authDC string, cached *aclCacheEntry, p *struc
return compiled, nil
}
// discoveryFilter is used to determine if we should return a given node
// or service based on the ACL passed in.
func (s *Server) discoveryFilter(node, service string, acl acl.ACL) bool {
if acl == nil {
return true
}
// Filter service discovery ACLs
if service != "" && service != ConsulServiceID && !acl.ServiceRead(service) {
s.logger.Printf("[DEBUG] consul: reading service '%s' denied due to ACLs", service)
return false
}
// Filtering passed
return true
}
// applyDiscoveryACLs is used to filter results from our service catalog based
// on the configured rules for the request ACL. Nodes or services which do
// not match the ACL rules will be dropped from the result.