[#311] Change object owner for anonymous put #317
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.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 {
|
||||
lock := new(object.Lock)
|
||||
lock.WriteMembers(prm.Locks)
|
||||
|
|
Loading…
Reference in a new issue