forked from TrueCloudLab/frostfs-s3-gw
[#455] Use contract to get containers
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
949fc0b484
commit
2ad2531d3a
16 changed files with 193 additions and 47 deletions
|
@ -621,6 +621,16 @@ func (t *TestFrostFS) AddContainerPolicyChain(_ context.Context, prm frostfs.Prm
|
|||
return nil
|
||||
}
|
||||
|
||||
func (t *TestFrostFS) GetContainerByID(cid cid.ID) (*container.Container, error) {
|
||||
for k, v := range t.containers {
|
||||
if k == cid.EncodeToString() {
|
||||
return v, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("container does not exist %s", cid)
|
||||
}
|
||||
|
||||
func (t *TestFrostFS) checkAccess(cnrID cid.ID, owner user.ID) bool {
|
||||
cnr, ok := t.containers[cnrID.EncodeToString()]
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue