acl: Associate policy ID

This commit is contained in:
Armon Dadgar 2014-08-08 16:51:19 -07:00
parent b5c9e65175
commit 45f358e715
2 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ func (c *Cache) getPolicy(id, rules string) (*Policy, error) {
if err != nil {
return nil, err
}
policy.ID = id
c.policyCache.Add(id, policy)
return policy, nil

View File

@ -14,6 +14,7 @@ const (
// Policy is used to represent the policy specified by
// an ACL configuration.
type Policy struct {
ID string `hcl:"-"`
Keys []*KeyPolicy `hcl:"key"`
}