mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 14:35:07 +00:00
Fix files service auth (#71)
This commit is contained in:
@@ -46,7 +46,8 @@ func (e *Files) Save(ctx context.Context, req *files.SaveRequest, rsp *files.Sav
|
|||||||
if err != nil && err != model.ErrorNotFound {
|
if err != nil && err != model.ErrorNotFound {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if f.Owner != acc.ID {
|
// if file exists check ownership
|
||||||
|
if f.Id != "" && f.Owner != acc.ID {
|
||||||
return errors.New("Not authorized")
|
return errors.New("Not authorized")
|
||||||
}
|
}
|
||||||
err = e.db.Create(file)
|
err = e.db.Create(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user