presence: Allow bots to fetch realm presence data.

Before, presence information for an entire realm could only be queried via
the `POST /api/v1/users/me/presence` endpoint. However, this endpoint also
updates the presence information for the user making the request. Therefore,
bot users are not allowed to access this endpoint because they don't have
any presence data.

This commit adds a new endpoint `GET /api/v1/realm/presence` that just
returns the presence information for the realm of the caller.

Fixes #10651.
This commit is contained in:
Kevin Lin
2018-10-14 10:22:04 -07:00
committed by Tim Abbott
parent 7f075e0da2
commit b2c29274f3
3 changed files with 24 additions and 0 deletions

View File

@@ -116,6 +116,9 @@ v1_api_and_json_patterns = [
url(r'^realm/deactivate$', rest_dispatch,
{'POST': 'zerver.views.realm.deactivate_realm'}),
url(r'^realm/presence$', rest_dispatch,
{'GET': 'zerver.views.presence.get_statuses_for_realm'}),
# users -> zerver.views.users
#
# Since some of these endpoints do something different if used on