diff --git a/models/utils/common.go b/models/utils/common.go index a196317..ebb1c25 100755 --- a/models/utils/common.go +++ b/models/utils/common.go @@ -100,9 +100,12 @@ func ModelGenericUpdateOne(change map[string]interface{}, id string, a Accessor) obj := a.NewObj() b, _ := json.Marshal(r) json.Unmarshal(b, obj) - ok, r := r.CanUpdate(obj) - if !ok { - return nil, nil, 403, errors.New("you are not allowed to update :" + a.GetType().String()) + if !a.GetRequest().Admin { + var ok bool + ok, r = r.CanUpdate(obj) + if !ok { + return nil, nil, 403, errors.New("you are not allowed to update :" + a.GetType().String()) + } } r.UpToDate(a.GetUser(), a.GetPeerID(), false) if a.GetPeerID() == r.GetCreatorID() {