Get the current user's effective permissions
GET
/v1/users/me/permissions
const url = 'https://api.adversarial.com/api/v1/users/me/permissions';const options = {method: 'GET'};
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://api.adversarial.com/api/v1/users/me/permissionsReturns the user’s roles and a list of all granular permissions they have.
Permissions follow the format module:action (e.g., risks:write, incidents:write).
Responses
Section titled “Responses”User’s effective permissions
Media typeapplication/json
object
permissions
required
List of granular permissions (format: “module:action”)
Array<string>
roles
required
The role names the user holds in the organization
Array<string>
total_permissions
required
Total number of permissions
integer
Examplegenerated
{ "permissions": [ "example" ], "roles": [ "example" ], "total_permissions": 1}