ShouldVerifyAuthdisable on admin request
This commit is contained in:
@@ -106,15 +106,16 @@ func ModelGenericUpdateOne(change map[string]interface{}, id string, a Accessor)
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, nil, 403, errors.New("you are not allowed to update :" + a.GetType().String())
|
return nil, nil, 403, errors.New("you are not allowed to update :" + a.GetType().String())
|
||||||
}
|
}
|
||||||
|
if a.ShouldVerifyAuth() && !r.VerifyAuth("update", a.GetRequest()) {
|
||||||
|
return nil, nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r.UpToDate(a.GetUser(), a.GetPeerID(), false)
|
r.UpToDate(a.GetUser(), a.GetPeerID(), false)
|
||||||
if a.GetPeerID() == r.GetCreatorID() {
|
if a.GetPeerID() == r.GetCreatorID() {
|
||||||
r.Unsign()
|
r.Unsign()
|
||||||
r.Sign()
|
r.Sign()
|
||||||
}
|
}
|
||||||
if a.ShouldVerifyAuth() && !r.VerifyAuth("update", a.GetRequest()) {
|
|
||||||
return nil, nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
|
|
||||||
}
|
|
||||||
loaded := r.Serialize(r) // get the loaded object
|
loaded := r.Serialize(r) // get the loaded object
|
||||||
|
|
||||||
for k, v := range change { // apply the changes, with a flatten method
|
for k, v := range change { // apply the changes, with a flatten method
|
||||||
|
|||||||
Reference in New Issue
Block a user