Roles

"Roles" refer to a feature that enables the management and control of user roles and permissions within an application. Roles define different levels of access and permissions, ensuring users only have access to relevant functionality and data. Administrators can create and define roles based on application requirements, associating them with specific permissions. This role-based access control allows for granular control over user actions and data access. The Roles feature in our Accelerator product provides a scalable solution for secure and controlled access to application functionality and data based on user roles.

Roles Data Model

Name
Data
Description

_id

String

System-generated unique identifier assigned to each role.

_createdAt

Date

System-generated timestamp that denotes the date and time when a role was created.

_createdBy

String

System-generated field that indicates the account who created.

_modifiedAt

Date

System-generated generated timestamp that denotes the date and time when a role was modified.

_modifiedBy

String

System-generated field that indicates the account who modified.

org

String

Represents the organization associated with the role in the system.

name

String

Represents the name of the role in the system.

label

String

Represents the label of the role in the system.

description

String

Represents the description of the role in the system.

status

String

Represents the status of the role in the system.

policies

Array

Represents the list of policies attached to the role in the system.

Example Roles

{
    "_id":
        {
            "$oid":"64392c4f862be321e3598f65"
        },
    "_createdAt":
        {
            "$date":
                {
                    "$numberLong":"1681468495815"
                }
        },
    "_createdBy":"[email protected]",
    "_modifiedAt":
        {
            "$date":
                {
                    "$numberLong":"1687865984008"
                }
        },
    "_modifiedBy":"[email protected]",
    "org":"64392b37862be321e3598f58",
    "name":"Provider",
    "label":"Providers215",
    "description":"",
    "status":"active",
    "policies":["64392c1d862be321e3598f63"]
}

Create a Role

post

Sample request:

POST api/v1/CreateRole
{        
  "name": "Patient",
  "policies": ["policyId"],
}
Authorizations
Body
namestringRequiredPattern: ^[a-zA-Z0-9_]*$
policiesstring[] | nullableOptional
Responses
200
Success
post
POST //api/v1/CreateRole HTTP/1.1
Host: api-qa.accelerator-platform.com
Authorization: YOUR_API_KEY
Content-Type: application/json-patch+json
Accept: */*
Content-Length: 35

{
  "name": "text",
  "policies": [
    "text"
  ]
}

No content

Get all Roles

get
Authorizations
Responses
200
Success
get
GET //api/v1/GetRoles HTTP/1.1
Host: api-qa.accelerator-platform.com
Authorization: YOUR_API_KEY
Accept: */*

No content

Get a Role

get
Authorizations
Path parameters
idstringRequired
Responses
200
Success
get
GET //api/v1/GetRole/{id} HTTP/1.1
Host: api-qa.accelerator-platform.com
Authorization: YOUR_API_KEY
Accept: */*

No content

Last updated