Check user permission in project
GET
/api/v1/rbac/check/permission/{permission}/project/{projectId}
const
url
=
'
https://localhost:8080/api/v1/rbac/check/permission/example/project/example
'
;
const
options
= {method:
'
GET
'
, headers: {Authorization:
'
'
}}
;
try
{
const
response
= await
fetch
(url
,
options);
const
data
= await
response
.
json
();
console
.
log
(data);
}
catch
(error) {
console
.
error
(error);
}
curl
--request
GET
\
--url
https://localhost:8080/api/v1/rbac/check/permission/example/project/example
\
--header
'
Authorization:
'
Report whether the authenticated user holds the given permission within the specified project
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”
permission
required
string
Permission name
projectId
required
string
Project ID
Responses
Section titled “ Responses ”Permission check result
Media type
application/json
object
context
string
hasPermission
boolean
permission
string
projectId
string
userId
string
Example
{
"context"
:
"
organization
"
,
"hasPermission"
:
true
,
"permission"
:
"
manage_org_settings
"
,
"projectId"
:
"
1
"
,
"userId"
:
"
550e8400-e29b-41d4-a716-446655440001
"
}
Unauthorized - Authentication required
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}