Check User Access
The Authorization API provides endpoints that allow you to call specific HasAccess()
checks against a selected resource. This allows you to view what the people in your environment can do with specific resources, as well as view their current roles and other assignments.
In the examples, be sure to replace {Your_Access_Token}
with your token and {Your_API_Key}
with the API key for your application.
HasAccessToResource
This endpoint allows you to check whether a person can perform operations against two resources, such as approving a request to add a person to a group.
HTTP Request
POST https://{FQDN_Of_Your_EmpowerID_Web_Server}/api/services/v1/hasaccess/hasaccesstoresource
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Content-Type | application/json |
Authorization | Bearer {Your_Access_Token} |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
resource1 | GUID of the resource targeted by the operation |
operation | Display Name of the operation |
Code Examples
$.ajax({
url: "https://{FQDN_Of_Your_EmpowerID_Web_Server}/api/services/v1/hasaccess/hasaccesstoresource",
type: "POST",
headers: {
"X-EmpowerID-API-Key": "{Your_API_Key}",
"Content-Type": "application/json",
"Authorization": "Bearer {Your_Access_Token}"
},
data: JSON.stringify({
"person": "jappleseed",
"resource": "a5a1ce79-69a3-41e0-a434-5670f654123a",
"operation": "resetpassword"
})
})
HasAccessToDualResource
This endpoint allows you to check whether a person can perform operations against two resources, such as approving a request to add a person to a group.
HTTP Request
POST https://{FQDN_Of_Your_EmpowerID_Web_Server}/api/services/v1/hasaccess/hasaccesstodualresource
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
resource1 | GUID of the first resource targeted by the operation |
operation | Display Name of the dual operation |
resource2 | GUID of the second resource targeted by the operation |
Code Examples
HasRoleForResource
This endpoint allows you to check whether a person has a specific Access Level for a set of given resources.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
role | Display Name of the Access Level |
resource | GUID of the resource |
Code Examples
HasAccessToWorkflow
This endpoint allows you to check whether a person can initiate a specific workflow.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
resource | Display Name of the workflow |
Code Examples
HasAccessToWorkflows
This endpoint allows you to check whether a person can initiate both of the specified workflows.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
workflows | Comma separated Display Name of each workflow |
Code Examples
HasAccessToPage
This endpoint allows you to check whether a person can view the specified page in the EmpowerID Web interface.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
page | GUID of the page |
Code Examples
HasAccessToPages
This endpoint allows you to check whether a person can view the specified pages in the EmpowerID Web interface.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
pages | Protected Application Resource GUID of the pages; Comma separated |
Code Examples
GetAllowedResources
This endpoint returns a list of resources the specified user can see.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | EmpowerID login of the person you are checking |
pages | GUID of the parent application |
Code Examples
Results
Returns a JSON object containing the GUID of all controls for a specified parent application that the person can see.
HasManagementRoles
This endpoint allows you to check whether a person has all of the specified Management Roles.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
managementRoles | GUID of each Management Role; Comma separated |
Code Examples
Results
Returns a Boolean. If true, the person has the specified Management Roles; if false, the person does not have one or more of the roles.
IsInManagementRole
This endpoint allows you to check whether a person has the specified Management Role.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
managementRole | GUID of the Management Role |
Code Examples
Results
Returns a Boolean. If true, the person has the specified Management Role; if false, the person does not.
IsInGroup
This endpoint allows you to check whether a person belongs to a specific group.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
group | GUID of the Group |
Code Examples
Results
Returns a Boolean. If true, the person is in the group; if false, the person is not.
HasGroups
This endpoint allows you to check whether a person belongs to each of the specified groups.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
groups | GUID of each Group; Comma separated |
Code Examples
Results
Returns a Boolean. If true, the person belongs to all of the specified groups; if false, the person is not a member of one or more of the groups.
IsInBusinessRole
This endpoint allows you to check whether a person has a specific Business Role.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
businessRole | ResourceID of the Business Role |
Code Examples
Results
Returns a Boolean. If true, the person has the specified Business Role; if false, the person does not.
HasBusinessRoles
This endpoint allows you to check whether a person belongs to each of the specified Business Roles.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
businessRoles | ResourceID of each Business Role; Comma separated |
Code Examples
Results
Returns a Boolean. If true, the person all of the specified Business Role; if false, the person does not belong to one or more of the roles.
IsInBusinessRoleAndLocation
This endpoint allows you to check whether a person belongs to a specified Business Role and Location combination.
HTTP Request
Header Key/Value Pairs
Key | Value |
---|---|
X-EmpowerID-API-Key | The API key for your OAuth application |
Authorization | Bearer {Your_Access_Token} |
Content-Type | application/json |
Payload Name/Value Pairs
Name | Value |
---|---|
person | PersonID of the person you are checking |
businessRoleAndLocation | ResourceID of each Business Role; Comma separated |
Code Examples
Results
Returns a Boolean. If true, the person to the specified Business Role; if false, the person does not.
IN THIS ARTICLE