[#293] pkg/eacl: Implement generator of Record
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
88a3829b39
commit
f406463c34
1 changed files with 15 additions and 0 deletions
|
@ -2,6 +2,8 @@ package eacltest
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl"
|
||||
cidtest "github.com/nspcc-dev/neofs-api-go/pkg/container/id/test"
|
||||
ownertest "github.com/nspcc-dev/neofs-api-go/pkg/owner/test"
|
||||
)
|
||||
|
||||
// Target returns random eacl.Target.
|
||||
|
@ -16,3 +18,16 @@ func Target() *eacl.Target {
|
|||
|
||||
return x
|
||||
}
|
||||
|
||||
// Record returns random eacl.Record.
|
||||
func Record() *eacl.Record {
|
||||
x := eacl.NewRecord()
|
||||
|
||||
x.SetAction(eacl.ActionAllow)
|
||||
x.SetOperation(eacl.OperationRangeHash)
|
||||
x.SetTargets(Target(), Target())
|
||||
x.AddObjectContainerIDFilter(eacl.MatchStringEqual, cidtest.Generate())
|
||||
x.AddObjectOwnerIDFilter(eacl.MatchStringNotEqual, ownertest.Generate())
|
||||
|
||||
return x
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue