Add Messages API

as discussed in [Issue #4509](https://wiki.openstreetmap.org/w/index.php?title=Messaging_API_proposal)
and documented in [Messaging API reference](https://wiki.openstreetmap.org/w/index.php?title=Messaging_API_proposal)
This commit is contained in:
Milan Cvetkovic 2024-03-11 13:14:04 +00:00
parent 898731ed81
commit 0db47f3f76
16 changed files with 851 additions and 4 deletions

View file

@ -19,6 +19,8 @@ class ApiCapability
can [:gpx_files], User if scope?(token, :read_gpx)
can [:index, :show], UserPreference if scope?(token, :read_prefs)
can [:update, :update_all, :destroy], UserPreference if scope?(token, :write_prefs)
can [:inbox, :outbox, :show, :update, :destroy], Message if scope?(token, :consume_messages)
can [:create], Message if scope?(token, :send_messages)
if user.terms_agreed?
can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset if scope?(token, :write_api)