API Docs for: 2.6
Show:

plugin_rest_authorization Class

Module: plugins_rest
Parent Module: com_authorization_rest

REST plugin that provides authorization functions through the following REST API:

GET requests

  1. authorization/user
  2. authorization/allusers

authorization/user

Returns the user authorizations.

Example JSON response:

{
    "spy": true,
    "dnd": true,
    "cdr": true,
    "sms": true,
    "chat": true,
    "no_spy": true,
    "postit": true,
    "trunks": true,
    "queues": true,
    "intrude": true,
    "privacy": false,
    "parkings": true,
    "admin_cdr": true,
    "streaming": true,
    "admin_sms": true,
    "recording": true,
    "phonebook": true,
    "extensions": true,
    "admin_queues": true,
    "admin_pickup": true,
    "admin_postit": true,
    "admin_hangup": true,
    "pickup_groups": false,
    "customer_card": true,
    "admin_transfer": true,
    "phone_redirect": true,
    "operator_groups": true,
    "admin_recording": true,
    "attended_transfer": true
}

authorization/allusers

Returns the authorizations of all users.

Example JSON response:

{
    "alessandro": {
         "spy": true,
         "dnd": true,
         ...
    },
    "andrea": {
         "spy": true,
         "dnd": true,
         ...
    }
}

Methods

allusers

(
  • req
  • res
  • next
)

Get the authorizations of all users by the following REST API:

allusers

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

setCompAuthorization

(
  • ca
)

Set authorization architect component.

Parameters:

  • ca Object

    The authorization architect component.

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

user

(
  • req
  • res
  • next
)

Get all user authorizations by the following REST API:

user

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

Properties

compAuthorization

Object private

The architect component to be used for authorization functions.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • user String

    To get all user authorizations

  • allusers String

    To get the authorizations of all users

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/authorization]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console