Skip to content

Commit a4d8b2f

Browse files
committed
PROGX-837: Documentation for permissions API
1 parent 1774ffd commit a4d8b2f

File tree

6 files changed

+160
-1
lines changed

6 files changed

+160
-1
lines changed

content/files/Akeneo PIM API.postman_collection.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5100,6 +5100,84 @@
51005100
}
51015101
]
51025102
},
5103+
{
5104+
"info": {
5105+
"name": "Permissions (Channels)",
5106+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
5107+
},
5108+
"item": [
5109+
{
5110+
"name": "Get User Channels Permissions",
5111+
"request": {
5112+
"method": "GET",
5113+
"header": [
5114+
{
5115+
"key": "Authorization",
5116+
"value": "Bearer {{token}}"
5117+
},
5118+
{
5119+
"key": "Content-type",
5120+
"value": "application/json"
5121+
}
5122+
],
5123+
"url": {
5124+
"raw": "{{url}}/api/rest/v1/permissions/{{userId}}/channels",
5125+
"host": [
5126+
"{{url}}"
5127+
],
5128+
"path": [
5129+
"api",
5130+
"rest",
5131+
"v1",
5132+
"permissions",
5133+
"{{userId}}",
5134+
"channels"
5135+
]
5136+
}
5137+
},
5138+
"response": []
5139+
}
5140+
]
5141+
},
5142+
{
5143+
"info": {
5144+
"name": "Permissions (Locales)",
5145+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
5146+
},
5147+
"item": [
5148+
{
5149+
"name": "Get User Locales Permissions",
5150+
"request": {
5151+
"method": "GET",
5152+
"header": [
5153+
{
5154+
"key": "Authorization",
5155+
"value": "Bearer {{token}}"
5156+
},
5157+
{
5158+
"key": "Content-type",
5159+
"value": "application/json"
5160+
}
5161+
],
5162+
"url": {
5163+
"raw": "{{url}}/api/rest/v1/permissions/{{userId}}/locales",
5164+
"host": [
5165+
"{{url}}"
5166+
],
5167+
"path": [
5168+
"api",
5169+
"rest",
5170+
"v1",
5171+
"permissions",
5172+
"{{userId}}",
5173+
"locales"
5174+
]
5175+
}
5176+
},
5177+
"response": []
5178+
}
5179+
]
5180+
},
51035181
{
51045182
"name": "Authentification by password",
51055183
"event": [

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/swagger/paths.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
/api/rest/v1/jobs/import/{code}:
4545
$ref: ./resources/jobs/routes/import.yaml
4646

47+
/api/rest/v1/permissions/{user_id}/locales:
48+
$ref: ./resources/permissions/routes/locales.yaml
49+
/api/rest/v1/permissions/{user_id}/channels:
50+
$ref: ./resources/permissions/routes/channels.yaml
51+
4752
/api/rest/v1/families:
4853
$ref: ./resources/families/routes/families.yaml
4954
/api/rest/v1/families/{code}:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
get:
2+
summary: Get user's channels permissions
3+
operationId: get_permissions_channels
4+
description: This endpoint allows you to get the channels' permissions for a given user.
5+
tags:
6+
- Permissions
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- name: user_id
11+
in: path
12+
type: string
13+
description: User ID
14+
required: true
15+
responses:
16+
200:
17+
description: OK
18+
x-details: Returns the user's channels permissions
19+
x-examples-per-version:
20+
- x-version: 'SaaS'
21+
x-example:
22+
userId: "12345"
23+
channels:
24+
ecommerce:
25+
canView: "true"
26+
canEdit: "false"
27+
mobile:
28+
canView: "false"
29+
canEdit: "true"
30+
401:
31+
$ref: "#/responses/401Error"
32+
403:
33+
$ref: "#/responses/403Error"
34+
404:
35+
$ref: "#/responses/404Error"
36+
406:
37+
$ref: "#/responses/406Error"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
get:
2+
summary: Get user's locales permissions
3+
operationId: "get_permissions_locales"
4+
description: This endpoint allows you to get the locales' permissions about a given user.
5+
tags:
6+
- Permissions
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- name: user_id
11+
in: path
12+
type: string
13+
description: User ID
14+
required: true
15+
responses:
16+
200:
17+
description: OK
18+
x-details: Returns the User's locales permissions
19+
x-examples-per-version:
20+
- x-version: 'SaaS'
21+
x-example:
22+
userId: "12345"
23+
locales:
24+
en_US:
25+
canView: "true"
26+
canEdit: "false"
27+
fr_FR:
28+
canView: "false"
29+
canEdit: "true"
30+
401:
31+
$ref: "#/responses/401Error"
32+
403:
33+
$ref: "#/responses/403Error"
34+
404:
35+
$ref: "#/responses/404Error"
36+
406:
37+
$ref: "#/responses/406Error"

tasks/reference.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ function determineCategory(tag){
8484
return 'Extensions';
8585
case 'Jobs':
8686
return 'Jobs';
87+
case 'Permissions':
88+
return 'Permissions';
8789
default:
8890
return 'Utilities';
8991
}

0 commit comments

Comments
 (0)