mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +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 {
|
||||
return err
|
||||
}
|
||||
if f.Owner != acc.ID {
|
||||
// if file exists check ownership
|
||||
if f.Id != "" && f.Owner != acc.ID {
|
||||
return errors.New("Not authorized")
|
||||
}
|
||||
err = e.db.Create(file)
|
||||
|
||||
Reference in New Issue
Block a user