func (s *Server) aclLocalFault(id string) (string, string, error) {
	defer metrics.MeasureSince([]string{"consul", "acl", "fault"}, time.Now())

	// Query the state store.
	state := s.fsm.State()
	_, acl, err := state.ACLGet(nil, id)
	if err != nil {
		return "", "", err
	}
	if acl == nil {
		return "", "", errors.New(aclNotFound)
	}

	// Management tokens have no policy and inherit from the 'manage' root
	// policy.
	if acl.Type == structs.ACLTypeManagement {
		return "manage", "", nil
	}

	// Otherwise use the default policy.
	return s.config.ACLDefaultPolicy, acl.Rules, nil
}
// aclLocalFault is used by the authoritative ACL cache to fault in the rules
// for an ACL if we take a miss. This goes directly to the state store, so it
// assumes its running in the ACL datacenter, or in a non-ACL datacenter when
// using its replicated ACLs during an outage.
aclLocalFault is used by the authoritative ACL cache to fault in the rules
for an ACL if we take a miss. This goes directly to the state store, so it
assumes its running in the ACL datacenter, or in a non-ACL datacenter when
using its replicated ACLs during an outage.
// aclLocalFault is used by the authoritative ACL cache to fault in the rules // for an ACL if we take a miss . This goes directly to the state store so it // assumes its running in the ACL datacenter or in a non - ACL datacenter when // using its replicated ACLs during an outage .
func (s *Server) aclLocalFault(id string) (string, string, error) {
	defer metrics.MeasureSince([]string{"consul", "acl", "fault"}, time.Now())
	state := s.fsm.State()
	_, acl, err := state.ACLGet(nil, id)
	if err != nil {
		return "", "", err
	}
	if acl == nil {
		return "", "", errors.New(aclNotFound)
	}
	if acl.Type == structs.ACLTypeManagement {
		return "manage", "", nil
	}
	return s.config.ACLDefaultPolicy, acl.Rules, nil
}
func ( s * Server ) aclLocalFault ( id string ) ( string , string , error ) { defer metrics . MeasureSince ( [ ] string { " " , " " , " " } , time . Now ( ) ) state := s . fsm . State ( ) _ , acl , err := state . ACLGet ( nil , id ) if err != nil { return " " , " " , err } if acl == nil { return " " , " " , errors . New ( aclNotFound ) } if acl . Type == structs . ACLTypeManagement { return " " , " " , nil } return s . config . ACLDefaultPolicy , acl . Rules , nil }
aclLocalFault is used by the authoritative ACL cache to fault in the rules
for an ACL if we take a miss.
aclLocalFault is used by the authoritative ACL cache to fault in the rules for an ACL if we take a miss .
// Query the state store. // Management tokens have no policy and inherit from the 'manage' root // policy. // Otherwise use the default policy.