policy/main.go
2022-08-04 18:49:45 +10:00

33 lines
727 B
Go

package main
import (
"fmt"
"gitstore.ru/tolikproh/policy/acl"
)
func main() {
acl1 := acl.NewAclBit(1, acl.AllAttr)
acl2 := acl.NewAclBit(2, acl.NullAttr)
acl3 := acl.NewAclBit(1, "finance")
acl4 := acl.NewAclBit(8, "nofinance")
var a []acl.AclBit
a = append(a, *acl1, *acl2, *acl3, *acl4)
// randoms := 0
// for i := 0; i <= 16; i++ {
// fmt.Println(randoms, ":", acl1.StringAcl())
// randoms = rand.Intn(64)
// acl1.SetBitTrue(randoms)
// }
fmt.Println(a)
aclend := acl.NewAclBit(0, acl.NullAttr)
aclend.SetArray(a)
fmt.Println(aclend.StringAcl())
fmt.Println(aclend.Atr)
fmt.Println(aclend.GetBit(0))
fmt.Println(aclend.GetBit(1))
fmt.Println(aclend.GetBit(2))
fmt.Println(aclend.GetBit(3))
}