30 lines
642 B
Go
30 lines
642 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")
|
|
a := make([]acl.AclBit, 0)
|
|
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(2))
|
|
}
|