The built-in Role model represents a set of access controls that can apply to a specific user.
Page Contents
Note:
You can use the StrongLoop API Explorer to quickly construct and make requests to a LoopBack app running on the server.
If a LoopBack app is running on localhost
at port 3000
, then by default API Explorer is available at
http://localhost:3000/explorer/.
All of the endpoints in the Role REST API are inherited from the generic PersistedModel REST API. The reference is provided here for convenience.
Quick reference
URI Pattern |
HTTP Verb | Default Permission | Description | Arguments |
---|---|---|---|---|
|
POST | Allow |
Add role instance and persist to data source. |
JSON object (in request body) |
/roles |
GET | Deny | Find instances of roles that match specified filter. |
One or more filters in query parameters:
|
/roles |
PUT | Deny | Update / insert role instance and persist to data source. | JSON object (in request body) |
/roles/id |
GET | Deny | Find role by ID: Return data for the specified role instance ID. | id, the role instance ID (in URI path) |
/roles/id |
PUT | Deny | Update attributes for specified role ID and persist. |
Query parameters:
|
/roles/id |
DELETE | Deny | Delete role with specified instance ID. | id, role ID (in URI path) |
/roles/id/exists |
GET | Deny |
Check instance existence: Return true if specified role ID exists. |
URI path:
|
/roles/count |
GET | Deny |
Return the number of role instances that matches specified where clause. |
Where filter specified in query parameter |
/roles/findOne |
GET | Deny |
Find first role instance that matches specified filter. |
Same as Find matching instances. |