diff --git a/policy.go b/policy.go index ebf88ae..e2cacfc 100644 --- a/policy.go +++ b/policy.go @@ -326,9 +326,14 @@ func (ext *ACLExt) Field(name string) interface{} { }) } +var ErrorSignalAction = Action{"ERROR_RESP"} +var DefaultACLPolicies = []Policy{ + NewAllNodesPolicy(Actions{ErrorSignalAction}), +} + func NewACLExt(policies ...Policy) *ACLExt { policy_map := map[PolicyType]Policy{} - for _, policy := range(policies) { + for _, policy := range(append(policies, DefaultACLPolicies...)) { existing, exists := policy_map[policy.Type()] if exists == true { policy = existing.Merge(policy) diff --git a/signal.go b/signal.go index 5ec96d2..d82f2c4 100644 --- a/signal.go +++ b/signal.go @@ -148,6 +148,10 @@ type ErrorSignal struct { Error error `json:"error"` } +func (signal ErrorSignal) Permission() Action { + return ErrorSignalAction +} + func NewErrorSignal(req_id uuid.UUID, err error) ErrorSignal { return ErrorSignal{ BaseSignal: BaseSignal{