diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2017-06-30 22:56:07 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2017-06-30 22:56:07 +0200 |
commit | ef81051f7d0a18709ce182bd706c1e4c5fc2a6e9 (patch) | |
tree | 80e106b23f88165a490df2053666ed7d629db040 /acl | |
parent | 2a0620b4fc7e33066998d6fe709625c009a9fe28 (diff) | |
download | petrific-ef81051f7d0a18709ce182bd706c1e4c5fc2a6e9.tar.gz petrific-ef81051f7d0a18709ce182bd706c1e4c5fc2a6e9.tar.bz2 petrific-ef81051f7d0a18709ce182bd706c1e4c5fc2a6e9.zip |
Use ACLs in tree objects
Diffstat (limited to 'acl')
-rw-r--r-- | acl/acl.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -31,6 +31,20 @@ func (p Perm) String() string { type QualifiedPerms map[string]Perm +func (a QualifiedPerms) Equals(b QualifiedPerms) bool { + if len(a) != len(b) { + return false + } + + for k, va := range a { + if vb, ok := b[k]; !ok || vb != va { + return false + } + } + + return true +} + type ACL struct { User, Group, Other, Mask QualifiedPerms } @@ -132,3 +146,10 @@ func ParseACL(s string) (ACL, error) { return acl, nil } + +func (a ACL) Equals(b ACL) bool { + return a.User.Equals(b.User) && + a.Group.Equals(b.Group) && + a.Other.Equals(b.Other) && + a.Mask.Equals(b.Mask) +} |