API Docs for:
Show:

authorization Class

Module: authorization

Provides the authorization functions.

Item Index

Events

Methods

authorizeAdminCallerNoteUser

(
  • username
)
Boolean

Returns true if the specified user has the admin caller note authorization. The admin caller note authorization coincides with admin post-it authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin caller note authorization.

authorizeAdminCdrUser

(
  • username
)
Boolean

Return true if the specified user has the authorization to view the cdr of all extensions.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the switchboard history authorization.

authorizeAdminHangupUser

(
  • username
)
Boolean

Returns true if the specified user has the administration hangup authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration hangup authorization.

authorizeAdminOffhourUser

(
  • username
)
Boolean

Returns true if the specified user has the admin_offhour authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin offhour authorization.

authorizeAdminParkingsUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to park any call and to pickup any parked call using any extension as destination.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin_parkings authorization.

authorizeAdminPhonebookUser

(
  • username
)
Boolean

Return true if the specified user has the admin phonebook authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin phonebook authorization.

authorizeAdminPhoneUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to originate a call from any extension.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin_call authorization.

authorizeAdminPickupUser

(
  • username
)
Boolean

Returns true if the specified user has the administration pickup authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration pickup authorization.

authorizeAdminPostitUser

(
  • username
)
Boolean

Returns true if the specified user has the administration post-it authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration post-it authorization.

authorizeAdminQueuesUser

(
  • username
)
Boolean

Returns true if the specified user has the administration queues authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration queues authorization.

authorizeAdminRecordingUser

(
  • username
)
Boolean

Returns true if the specified user has the administration recording authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration recording authorization.

authorizeAdminSmsUser

(
  • username
)
Boolean

Returns true if the specified user has the administration sms authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration sms authorization.

authorizeAdminTransferUser

(
  • username
)
Boolean

Returns true if the specified user has the administration transfer authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the administration transfer authorization.

authorizeAdvancedOffhourUser

(
  • username
)
Boolean

Returns true if the specified user has the admin_offhour authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin offhour authorization.

authorizeCallerNoteUser

(
  • username
)
Boolean

Return true if the specified user has the caller note authorization. The caller note authorization coincides with post-it authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the caller note authorization.

authorizeCdrUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view the call detail recording (cdr).

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the history authorization.

authorizeCfUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view and set the call forward status of his endpoints.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the call forward authorization.

authorizeChatUser

(
  • username
)
Boolean

Return true if the specified user has the chat authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the chat authorization.

authorizeCustomerCardUser

(
  • username
)
Boolean

Return true if the specified user has at least one customer card authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has at least one customer card authorization.

authorizedCustomerCards

(
  • username
)
Array

Get the list of the authorized customer cards of the user.

Parameters:

  • username String

    The username

Returns:

Array:

The list of the authorized customer card of the user.

authorizeDndUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view and set the don't disturb status of his endpoints.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the don't disturb authorization.

authorizeIntrudeUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to intrude himself into the conversations.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to intrude.

authorizeLostQueueCallsUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view the lost calls of the queues.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to view the lost calls of the queues.

authorizeOffhourUser

(
  • username
)
Boolean

Returns true if the specified user has the offhour authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the offhour authorization.

authorizeOperatorGroupsUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view the groups of the operator panel.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the operator panel authorization.

authorizeOpParkingsUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view all parkings with their complete status information.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to view all parkings.

authorizeOpTrunksUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view all trunks with their complete status information.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to view all trunks.

authorizePhonebookUser

(
  • username
)
Boolean

Return true if the specified user has the phonebook authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the phonebook authorization.

authorizePhoneRedirectUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to the phone redirect.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the phone redirect authorization.

authorizePickupUser

(
  • username
  • endpointId
)
Boolean

Returns true if the specified user has the authorization to pickup a conversation of the specified extension.

Parameters:

  • username String

    The username

  • endpointId String

    The endpoint identifier (e.g. the extension number)

Returns:

Boolean:

True if the user has the authorization to pickup a conversation of the endpoint

authorizePostitUser

(
  • username
)
Boolean

Returns true if the specified user has the post-it authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the post-it authorization.

authorizePresencePanelUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view all extensions with their complete status information.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the operator panel authorization.

authorizeQManagerUser

(
  • username
)
Boolean

Returns true if the specified user has the queue manager authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the queue manager authorization.

authorizeQueuesUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to view all queues with their complete status information.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to view all queues.

authorizeRecordingUser

(
  • username
)
Boolean

Returns true if the specified user has the recording authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the recording authorization.

authorizeRemoteSiteUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to operate with remote sites.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to view all queues.

authorizeSmsUser

(
  • username
)
Boolean

Returns true if the specified user has the sms authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the sms authorization.

authorizeSpyUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to spy the conversations.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the authorization to spy.

authorizeStreamingSourceUser

(
  • username
  • streamingId
)
Boolean

Return true if the specified user has the authorization for the specified streaming source.

Parameters:

  • username String

    The username

  • streamingId String

    The streaming source identifier

Returns:

Boolean:

True if the user has the authorization for the specified streaming source.

authorizeStreamingUser

(
  • username
)
Boolean

Return true if the specified user has at least one streaming authorization.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has at least one streaming authorization.

authorizeUser

(
  • type
  • username
)
private

General function to check an authorization of a user. It's used by all authorization with boolean value. E.g. customer card authorization doesn't use this function.

Parameters:

  • type String

    The name of the authorization as reported by authorization_types.js

  • username String

    The username to check the authorization

config

(
  • obj
)

Set the user authorization by file. The file must use the JSON syntax.

Parameters:

  • obj Object
    • users String

      The path of the users file

    • profiles String

      The path of the profiles file

configRemoteOperators

(
  • path
)

Set the remote sites authorizations to view the operator panel groups by file. The file must use the JSON syntax.

Parameters:

  • path String

    The path of the authorization file for operator panel groups to be allowed for each remote site

getAllowedQManagerQueues

(
  • username
)
Array

Return the list of allowed qmanager queues.

Parameters:

  • username String

    The username

Returns:

Array:

The list of allowed qmanager queues.

getAllowedStreamingSources

(
  • username
)
Array

Return the list of allowed streaming sources.

Parameters:

  • username String

    The username

Returns:

Array:

The list of allowed streaming sources.

getAllUsersAuthorizations

() Object

Returns the authorizations of all users.

Returns:

Object:

The authorizations of all users.

getAuthorizedOperatorGroups

(
  • username
)
Object

Returns all the authorized groups of the operator panel of the user.

Parameters:

  • username String

    The username

Returns:

Object:

All the authorized operator panel groups.

getAuthorizedRemoteOperatorGroups

(
  • site
)
Object

Returns all the authorized groups of the operator panel for the specified remote site.

Parameters:

  • site String

    The remote site name

Returns:

Object:

All the authorized operator panel groups for the specified remote site.

getUserAuthorizations

(
  • username
)
Object

Returns all authorizations of the user.

Parameters:

  • username String

    The username

Returns:

Object:

All authorizations of the user.

getUserProfileId

(
  • username
)
String private

Returns the profile number identifier.

Parameters:

  • username String

    The username

Returns:

String:

The profile number identifier.

getUserProfileJSON

(
  • username
)
Object

Return the authorization profile fo the user in JSON format.

Parameters:

  • username String

    The username

Returns:

Object:

The authorization profile in JSON format.

isPrivacyEnabled

(
  • username
)
Boolean

Returns true if the specified user has the privacy enabled.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the privacy enabled.

on

(
  • type
  • cb
)
Object

Subscribe a callback function to a custom event fired by this object. It's the same of nodejs events.EventEmitter.on method.

Parameters:

  • type String

    The name of the event

  • cb Function

    The callback to execute in response to the event

Returns:

Object:

A subscription handle capable of detaching that subscription.

reload

()

Reload the component.

reset

()

Reset the component.

setCompDbconn

(
  • comp
)
private

Set dbconn module to be used.

Parameters:

  • comp Object

    The dbconn module

setCompUser

(
  • comp
)
private

Set user module to be used.

Parameters:

  • comp Object

    The user module

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.

verifyOffhourListenAnnouncement

(
  • username
  • announcementId
  • cb
)

Check if the user has the permission to listen audio file of announcement. Returns true if the announcement is owned by the specified user or has the "public" visibility.

Parameters:

  • username String

    The user to verify

  • announcementId String

    The announcement identifier

  • cb Function

    The callback function

verifyOffhourUserAnnouncement

(
  • username
  • announcementId
  • cb
)

Check if the user has the permission on audio file for announcement. Returns true if the announcement is owned by the specified user.

Parameters:

  • username String

    The user to verify

  • announcementId String

    The announcement identifier

  • cb Function

    The callback function

verifyUserEndpointCellphone

(
  • username
  • endpoint
)
Boolean

Checks if the cellphone endpoint is owned by the specified user.

Parameters:

  • username String

    The username

  • endpoint String

    The identifier of the cellphone endpoint

Returns:

Boolean:

True if the cellphone endpoint is owned by the user, false otherwise.

verifyUserEndpointExten

(
  • username
  • endpoint
)
Boolean

Checks if the extension endpoint is owned by the specified user.

Parameters:

  • username String

    The username

  • endpoint String

    The identifier of the extension endpoint

Returns:

Boolean:

True if the extension endpoint is owned by the user, false otherwise.

verifyUserEndpointVoicemail

(
  • username
  • endpoint
)
Boolean

Checks if the voicemail endpoint is owned by the specified user.

Parameters:

  • username String

    The username

  • endpoint String

    The identifier of the endpoint

Returns:

Boolean:

True if the endpoint is owned by the user, false otherwise.

Properties

compDbconn

Object private

The dbconn module.

compUser

Object private

The user module.

emitter

Object private

The event emitter.

EVT_RELOADED

String

The name of the reloaded event.

Default: "reloaded"

IDLOG

String private final

The module identifier used by the logger.

Default: [authorization]

logger

Object private

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

Default: console

mapUserProfile

Object private

Mapping between users and profiles. The keys are the username and the values are the profiles ids.

profiles

Object private

Authorization profiles. The keys are the profiles ids and the values are the permissions.

PROFILES_CONF_FILEPATH

String private

The configuration file path of the profiles.

remoteOperatorsAutho

Object private

The permission to view local operator panel groups for each remote site.

USERS_CONF_FILEPATH

String private

The configuration file path of the users.

Events

reloaded

Fired when the componente has been reloaded.