Skip to content

Commit

Permalink
Check CID is set to eacl table in ContainerSetEACL command (#389)
Browse files Browse the repository at this point in the history
close #384
  • Loading branch information
roman-khimov authored Apr 17, 2023
2 parents c6bda42 + dfb7997 commit 8678b36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ type PrmContainerSetEACL struct {
}

// 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) {
x.table = table
x.tableSet = true
Expand Down Expand Up @@ -656,6 +656,11 @@ func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL)
panic("eACL table not set")
}

_, isCIDSet := prm.table.CID()
if !isCIDSet {
panic("missing container in eACL table")
}

// sign the eACL table
eaclV2 := prm.table.ToV2()

Expand Down

0 comments on commit 8678b36

Please sign in to comment.