Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

[NEW] Added docs to permissions.listAll endpoint and deprecated .list #1005

Merged
merged 4 commits into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Here you can also find what articles are incomplete and missing.
- statistics
- statistics.list
- Permissions:
- list
- list-all
- update
- Roles:
- create
Expand Down
11 changes: 6 additions & 5 deletions developer-guides/deprecation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ The methods and endpoints of the <b>Realtime API</b> and <b>Rest API</b>, respec

## REST API

| Endpoint | Release deprecated | Release removed |
| :----------------------- | :----------------- | :-------------- |
| `/user.roles` | 0.63.0 | 0.66.0 |
| `/channels.cleanHistory` | 0.64.0 | 0.67.0 |
| `/permissions` | 0.66.0 | 0.69.0 |
| Endpoint | Release deprecated | Release removed |
| :---------------------------- | :----------------- | :-------------- |
| `/user.roles` | 0.63.0 | 0.66.0 |
| `/channels.cleanHistory` | 0.64.0 | 0.67.0 |
| `/permissions` | 0.66.0 | 0.69.0 |
| `/permissions.list` | 0.73.0 | 0.85.0 |
8 changes: 4 additions & 4 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and

### Permissions

| Url | Short Description | Details Page |
| :--------------------------- | :------------------------------- | :-------------------------- |
| `/api/v1/permissions.list` | Lists permissions on the server. | [Link](permissions/list/) |
| `/api/v1/permissions.update` | Edits permissions on the server. | [Link](permissions/update/) |
| Url | Short Description | Details Page |
| :------------------------------ | :------------------------------- | :-------------------------- |
| `/api/v1/permissions.listAll` | Lists permissions on the server. | [Link](permissions/list-all/)|
| `/api/v1/permissions.update` | Edits permissions on the server. | [Link](permissions/update/) |

### Roles

Expand Down
4 changes: 2 additions & 2 deletions developer-guides/rest-api/permissions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

| Url | Short Description | Details Page |
| :--- | :--- | :--- |
| `/api/v1/permissions.list` | Lists permissions on the server. | [Link](list/) |
| `/api/v1/permissions.update` | Edits permissions on the server. | [Link](update/) |
| `/api/v1/permissions.listAll` | Lists permissions on the server. | [Link](list-all/) |
| `/api/v1/permissions.update` | Edits permissions on the server. | [Link](update/) |
46 changes: 0 additions & 46 deletions developer-guides/rest-api/permissions/list/README.md

This file was deleted.

63 changes: 63 additions & 0 deletions developer-guides/rest-api/permissions/listall/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
permalink: /developer-guides/rest-api/permissions/list-all/
redirect_from:
- /developer-guides/rest-api/permissions/list/
---

# List Permissions

Returns all permissions from the server.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/permissions.listAll` | `yes` | `GET` |

## Query Parameters

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `updatedSince` | `2017-11-25T15:08:17.248Z` | Optional | Date as ISO string |

Both of these have the same result structure, however when you provide the `updatedSince` query parameter then the `update`
will contain only those updated and `remove` will contain those which have been removed.

## Example Call to get all of the rooms

```bash
curl -H "X-Auth-Token: ijFlJ1yfidXhwEYY284Anoq_iEsOeMMVCupzNhX22tB" \
-H "X-User-Id: hw5DThnhQmxDWnavu" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/permissions.listAll?updatedSince=2017-11-25T15:08:17.248Z
```

## Example Result

```json
{
"update": [
{
"_id": "access-permissions",
"_updatedAt": "2018-11-28T11:55:49.106Z",
"roles": [
"admin"
]
},
{
"_id": "add-oauth-service",
"_updatedAt": "2018-11-28T12:59:51.974Z",
"roles": [
"admin",
"user"
]
}
],
"remove": [],
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.73.0 | Added |