forked from TrueCloudLab/frostfs-sdk-go
Alex Vanin
94476f9055
Due to source code relocation from GitHub. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
45 lines
1,004 B
Go
45 lines
1,004 B
Go
package eacltest
|
|
|
|
import (
|
|
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl"
|
|
usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test"
|
|
versiontest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version/test"
|
|
)
|
|
|
|
// Target returns random eacl.Target.
|
|
func Target() *eacl.Target {
|
|
x := eacl.NewTarget()
|
|
|
|
x.SetRole(eacl.RoleSystem)
|
|
x.SetBinaryKeys([][]byte{
|
|
{1, 2, 3},
|
|
{4, 5, 6},
|
|
})
|
|
|
|
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.ID())
|
|
x.AddObjectOwnerIDFilter(eacl.MatchStringNotEqual, usertest.ID())
|
|
|
|
return x
|
|
}
|
|
|
|
func Table() *eacl.Table {
|
|
x := eacl.NewTable()
|
|
|
|
x.SetCID(cidtest.ID())
|
|
x.AddRecord(Record())
|
|
x.AddRecord(Record())
|
|
x.SetVersion(versiontest.Version())
|
|
|
|
return x
|
|
}
|