This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NEW] Add permissions.list and permissions.update, and deprecate perm…
…issions (#777) * Add permissions.list and permissions.update, and deprecate permissions * Fix CRLF issue, assuming that's what broke Travis
- Loading branch information
1 parent
2c16c52
commit f93b26c
Showing
7 changed files
with
119 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,6 @@ | ||
# Permissions | ||
# Permission Methods | ||
|
||
Returns all permissions from the server. | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| Url | Short Description | Details Page | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/permissions` | `yes` | `GET` | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl -H "X-Auth-Token: 6eWs4ECxUITYYoZ_bAYK5OE2srkxAepQqQA1cGGv3jK" \ | ||
-H "X-User-Id: hvzu8z6mHFigiXy6Y" \ | ||
http://localhost:3000/api/v1/permissions | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
[ | ||
{ | ||
"_id": "access-permissions", | ||
"roles": [ | ||
"admin" | ||
], | ||
"_updatedAt": "2018-01-25T13:03:20.879Z", | ||
"meta": { | ||
"revision": 0, | ||
"created": 1516980515815, | ||
"version": 0 | ||
}, | ||
"$loki": 1 | ||
},{ | ||
... | ||
} | ||
] | ||
``` | ||
|
||
## Change Log | ||
|
||
| Version | Description | | ||
| :--- | :--- | | ||
| 0.61.0 | Added. | | ||
| `/api/v1/permissions.list` | Lists permissions on the server. | [Link](list/) | | ||
| `/api/v1/permissions.update` | Edits permissions on the server. | [Link](update/) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# List Permissions | ||
|
||
Returns all permissions from the server. | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/permissions.list` | `yes` | `GET` | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl -H "X-Auth-Token: 6eWs4ECxUITYYoZ_bAYK5OE2srkxAepQqQA1cGGv3jK" \ | ||
-H "X-User-Id: hvzu8z6mHFigiXy6Y" \ | ||
http://localhost:3000/api/v1/permissions.list | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"permissions": [ | ||
{ | ||
"_id": "access-permissions", | ||
"roles": [ | ||
"admin" | ||
], | ||
"_updatedAt": "2018-01-25T13:03:20.879Z", | ||
"meta": { | ||
"revision": 0, | ||
"created": 1516980515815, | ||
"version": 0 | ||
}, | ||
"$loki": 1 | ||
},{ | ||
... | ||
} | ||
], | ||
"success": true | ||
} | ||
``` | ||
|
||
## Change Log | ||
|
||
| Version | Description | | ||
| :--- | :--- | | ||
| 0.66.0 | Added. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Update Permissions | ||
|
||
Edits permissions on the server. | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/permissions.update` | `yes` | `POST` | | ||
|
||
## Payload | ||
|
||
| Argument | Example | Required | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| `permissions` | `[{"_id": "access-permissions", "roles": ["admin"]}]` | Required | The array of roles to overwrite. | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \ | ||
-H "X-User-Id: aobEdbYhXfu5hkeqG" \ | ||
-H "Content-type:application/json" \ | ||
http://localhost:3000/api/v1/users.update \ | ||
-d '{"permissions": [{"_id": "access-permissions", "roles": ["admin"]}]}' | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"permissions": [ | ||
{ | ||
"_id": "access-permissions", | ||
"roles": [ | ||
"admin" | ||
], | ||
"_updatedAt": "2018-01-25T13:03:20.879Z", | ||
"meta": { | ||
"revision": 0, | ||
"created": 1516980515815, | ||
"version": 0 | ||
}, | ||
"$loki": 1 | ||
},{ | ||
... | ||
} | ||
], | ||
"success": true | ||
} | ||
``` | ||
|
||
## Change Log | ||
|
||
| Version | Description | | ||
| :--- | :--- | | ||
| 0.66.0 | Added. | |