forked from TrueCloudLab/frostfs-sdk-go
Check CID is set to eacl table in ContainerSetEACL command (#389)
close #384
This commit is contained in:
commit
8678b36ed9
1 changed files with 6 additions and 1 deletions
|
@ -602,7 +602,7 @@ type PrmContainerSetEACL struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetTable sets eACL table structure to be set for the container.
|
// SetTable sets eACL table structure to be set for the container.
|
||||||
// Required parameter.
|
// Required parameter and CID must be set inside the table.
|
||||||
func (x *PrmContainerSetEACL) SetTable(table eacl.Table) {
|
func (x *PrmContainerSetEACL) SetTable(table eacl.Table) {
|
||||||
x.table = table
|
x.table = table
|
||||||
x.tableSet = true
|
x.tableSet = true
|
||||||
|
@ -656,6 +656,11 @@ func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL)
|
||||||
panic("eACL table not set")
|
panic("eACL table not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, isCIDSet := prm.table.CID()
|
||||||
|
if !isCIDSet {
|
||||||
|
panic("missing container in eACL table")
|
||||||
|
}
|
||||||
|
|
||||||
// sign the eACL table
|
// sign the eACL table
|
||||||
eaclV2 := prm.table.ToV2()
|
eaclV2 := prm.table.ToV2()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue