Home Manual Reference Source
private class | source

RoleController

Controller class for the Role model.

Constructor Summary

Public Constructor
public

constructor(connection: Connection)

Member Summary

Private Members
private

Object to use for making a connection to the REST API and Websocket server.

Method Summary

Public Methods
public

getRole(roleId: string): Promise<Role>

Get a single role.

public

Get and return all roles available in the API.

Public Constructors

public constructor(connection: Connection) source

Params:

NameTypeAttributeDescription
connection Connection

Object to use for making a connection to the REST API and Websocket server.

Private Members

private _connection: Connection source

Object to use for making a connection to the REST API and Websocket server.

Public Methods

public getRole(roleId: string): Promise<Role> source

Get a single role.

Params:

NameTypeAttributeDescription
roleId string

Identifier of the role.

Return:

Promise<Role>

Promise containing a Role.

Throw:

Promise.<Error>

roleId parameter of type "string" is required.

Promise.<Error>

If no result could not be found.

public getRoles(): Promise<Role[]> source

Get and return all roles available in the API.

Return:

Promise<Role[]>

Promise containing an array of Roles.

Throw:

Promise.<Error>

If the server returned an error.