Adjust + Test

This commit is contained in:
mr
2026-02-18 12:24:19 +01:00
parent 842e09f22f
commit fa5c3a3c60
45 changed files with 1166 additions and 1192 deletions

View File

@@ -34,6 +34,8 @@ func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) {
data.SetID(data.GetID())
data.StoreDraftDefault()
data.UpToDate(a.GetUser(), a.GetPeerID(), true)
data.Unsign()
data.Sign()
f := dbs.Filters{
Or: map[string][]dbs.Filter{
"abstractresource.abstractobject.name": {{
@@ -97,6 +99,8 @@ func GenericUpdateOne(set DBObject, id string, a Accessor, new DBObject) (DBObje
}
set = newSet
r.UpToDate(a.GetUser(), a.GetPeerID(), false)
r.Unsign()
r.Sign()
if a.ShouldVerifyAuth() && !r.VerifyAuth("update", a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
}