[#311] Change object owner for anonymous put
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
4eb2c7fb7d
commit
391fc9cbe3
1 changed files with 6 additions and 0 deletions
|
@ -237,6 +237,12 @@ func (x *FrostFS) CreateObject(ctx context.Context, prm layer.PrmObjectCreate) (
|
||||||
obj.SetAttributes(attrs...)
|
obj.SetAttributes(attrs...)
|
||||||
obj.SetPayloadSize(prm.PayloadSize)
|
obj.SetPayloadSize(prm.PayloadSize)
|
||||||
|
|
||||||
|
if prm.BearerToken == nil && prm.PrivateKey != nil {
|
||||||
|
var owner user.ID
|
||||||
|
user.IDFromKey(&owner, prm.PrivateKey.PublicKey)
|
||||||
|
obj.SetOwnerID(&owner)
|
||||||
|
}
|
||||||
|
|
||||||
if len(prm.Locks) > 0 {
|
if len(prm.Locks) > 0 {
|
||||||
lock := new(object.Lock)
|
lock := new(object.Lock)
|
||||||
lock.WriteMembers(prm.Locks)
|
lock.WriteMembers(prm.Locks)
|
||||||
|
|
Loading…
Reference in a new issue