Skip to content

PROGX-837: Documentation for permissions API #1059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
67 changes: 67 additions & 0 deletions content/files/Akeneo PIM API.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -5100,6 +5100,73 @@
}
]
},
{
"name": "Permissions",
"item": [
{
"name": "Get User Channels Permissions",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
{
"key": "Content-type",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/api/rest/v1/permissions/{{userUuid}}/channels",
"host": [
"{{url}}"
],
"path": [
"api",
"rest",
"v1",
"permissions",
"{{userUuid}}",
"channels"
]
}
},
"response": []
},
{
"name": "Get User Locales Permissions",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
{
"key": "Content-type",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/api/rest/v1/permissions/{{userUuid}}/locales",
"host": [
"{{url}}"
],
"path": [
"api",
"rest",
"v1",
"permissions",
"{{userUuid}}",
"locales"
]
}
},
"response": []
}
]
},
{
"name": "Authentification by password",
"event": [
Expand Down
2 changes: 1 addition & 1 deletion content/swagger/akeneo-web-api.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions content/swagger/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
/api/rest/v1/jobs/import/{code}:
$ref: ./resources/jobs/routes/import.yaml

/api/rest/v1/permissions/{user_uuid}/locales:
$ref: ./resources/permissions/routes/locales.yaml
/api/rest/v1/permissions/{user_uuid}/channels:
$ref: ./resources/permissions/routes/channels.yaml

/api/rest/v1/families:
$ref: ./resources/families/routes/families.yaml
/api/rest/v1/families/{code}:
Expand Down
37 changes: 37 additions & 0 deletions content/swagger/resources/permissions/routes/channels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
get:
summary: Get user's channels permissions
operationId: get_permissions_channels
description: This endpoint allows you to get the channels' permissions for a given user.
tags:
- Permissions
x-versions:
- "SaaS"
parameters:
- name: user_uuid
in: path
type: string
description: User UUID
required: true
responses:
200:
description: OK
x-details: Returns the user's channels permissions
x-examples-per-version:
- x-version: 'SaaS'
x-example:
userUuid: "abcd1234-5678-90ef-ghij-klmnopqrstuv"
channels:
ecommerce:
canView: "true"
canEdit: "false"
mobile:
canView: "false"
canEdit: "true"
401:
$ref: "#/responses/401Error"
403:
$ref: "#/responses/403Error"
404:
$ref: "#/responses/404Error"
406:
$ref: "#/responses/406Error"
37 changes: 37 additions & 0 deletions content/swagger/resources/permissions/routes/locales.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
get:
summary: Get user's locales permissions
operationId: "get_permissions_locales"
description: This endpoint allows you to get the locales' permissions about a given user.
tags:
- Permissions
x-versions:
- "SaaS"
parameters:
- name: user_uuid
in: path
type: string
description: User UUID
required: true
responses:
200:
description: OK
x-details: Returns the User's locales permissions
x-examples-per-version:
- x-version: 'SaaS'
x-example:
userUuid: "abcd1234-5678-90ef-ghij-klmnopqrstuv"
locales:
en_US:
canView: "true"
canEdit: "false"
fr_FR:
canView: "false"
canEdit: "true"
401:
$ref: "#/responses/401Error"
403:
$ref: "#/responses/403Error"
404:
$ref: "#/responses/404Error"
406:
$ref: "#/responses/406Error"
2 changes: 2 additions & 0 deletions tasks/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function determineCategory(tag){
return 'Extensions';
case 'Jobs':
return 'Jobs';
case 'Permissions':
return 'Permissions';
default:
return 'Utilities';
}
Expand Down