User Permissions¶
Attempt to retrieve permissions of a user specified by a user id.
Request¶
Parameters¶
Parameter | Type | Required | Notes |
---|---|---|---|
id | Path | yes | defines id of user |
Request body¶
This endpoint does not have a request body
curl --location 'https://devapi.juno.one/users/perms/308' \
--header 'X-TenantID: development' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4MjMzOTQwNn0.XWAuQmaKsv5fh60umfYO2gMwtXUjWLWsy6HbDt_fQXV6HPhgQhMkqmmzhWaCXsUP9h-dvKrQowLdqBqHHTYQAA'
import requests
url = "https://devapi.juno.one/users/perms/2"
payload = {}
headers = {
'X-TenantID': 'development',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
val client = OkHttpClient()
val request = Request.Builder()
.url("https://devapi.juno.one/users/perms/2")
.addHeader("X-TenantID", "development")
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA")
.build()
val response = client.newCall(request).execute()
Response¶
The successful response of get user permissions has the status 200
with the following response body:
{
"data": {
"userById": {
"user": {
"id": 1,
"firstname": "test",
"lastname": "test",
"description": null,
"email": "test@juno.one",
"superadmin": true,
"language": "en",
"avatar": "1",
"teams": [
{
"id": 1,
"name": "demo team",
"deleted": false,
"deleted_at": null,
"created_at": "2021-08-04T10:20:11.000Z",
"updated_at": "2021-08-04T10:20:11.000Z",
"roles": [
{
"id": 1,
"name": "demo role",
"deleted": false,
"deleted_at": null,
"created_at": "2021-08-04T10:20:11.000Z",
"updated_at": "2021-08-04T10:20:11.000Z",
"perms": [
{
"id": 1,
"module_id": 9,
"module_name": "privilege.module.settings",
"position": 1,
"position_name": "privilege.module.settTeams",
"column_id": 1,
"disabled": false,
"name": "view teams",
"description": "privilege.viewTeams",
"guard_name": "api",
"created_at": "2023-01-16T14:37:21.000Z",
"updated_at": "2023-01-16T14:37:21.000Z"
}
]
}
]
}
]
},
"roles": [
"demo role"
],
"permissions": [
"view teams"
],
"teams": [
{
"id": 1,
"name": "demo team",
"deleted": false,
"deleted_at": null,
"created_at": "2021-08-04T10:20:11.000Z",
"updated_at": "2021-08-04T10:20:11.000Z",
"roles": [
{
"id": 1,
"name": "demo role",
"deleted": false,
"deleted_at": null,
"created_at": "2021-08-04T10:20:11.000Z",
"updated_at": "2021-08-04T10:20:11.000Z",
"perms": [
{
"id": 1,
"module_id": 9,
"module_name": "privilege.module.settings",
"position": 1,
"position_name": "privilege.module.settTeams",
"column_id": 1,
"disabled": false,
"name": "view teams",
"description": "privilege.viewTeams",
"guard_name": "api",
"created_at": "2023-01-16T14:37:21.000Z",
"updated_at": "2023-01-16T14:37:21.000Z"
}
]
}
]
}
]
},
"permissionsData": {
"createPermissions": [
"create test case"
],
"routePermissions": [
"view menu dashboard",
"view menu projects"
],
"projectPermissions": [
{
"project": 1,
"projectPermissions": [
"edit dashboard",
"close project"
]
}
],
"otherPermissions": [
"delete user profile",
"impersonate user profile"
]
}
}
}
404
Not found
406
Insufficient permision.