Make api show/update/destroy node actions resourceful

This commit is contained in:
Anton Khorev 2025-02-01 14:01:01 +03:00
parent 7cf9bf0e55
commit 3b0be171b9
4 changed files with 11 additions and 12 deletions

View file

@ -38,7 +38,8 @@ class ApiAbility
if user.terms_agreed?
can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset if scope?(token, :write_api)
can :create, ChangesetComment if scope?(token, :write_api)
can [:create, :update, :delete], [Node, Way, Relation] if scope?(token, :write_api)
can [:create, :update, :destroy], [Node] if scope?(token, :write_api)
can [:create, :update, :delete], [Way, Relation] if scope?(token, :write_api)
end
if user.moderator?