frostfs-api-go/pkg/acl/eacl/table_test.go
Alex Vanin edf2e2d62f [#139] sdk/acl: Add eACL structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00

17 lines
467 B
Go

package eacl_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl"
"github.com/nspcc-dev/neofs-crypto/test"
)
func TextExample(t *testing.T) {
record := eacl.CreateRecord(eacl.ActionDeny, eacl.OperationPut)
record.AddFilter(eacl.HeaderFromObject, eacl.MatchStringEqual, "filename", "cat.jpg")
record.AddTarget(eacl.RoleOthers, test.DecodeKey(1).PublicKey, test.DecodeKey(2).PublicKey)
table := eacl.NewTable()
table.AddRecord(record)
}