API Docs for: 2.6
Show:

authorization Class

Module: authorization

Provides the authorization functions.

Methods

authorizeAdminAnswerUser

(
  • username
)
Boolean

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

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the admin_answer authorization.

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.

authorizeAdminCallUser

(
  • 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.

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.

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.

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.

authorizeAttendedTransferUser

(
  • username
)
Boolean

Returns true if the specified user has the authorization to the attended transfer calls.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the attended transfer calls 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.

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

Gets the name of the authorized customer cards of the user.

Parameters:

  • username String

    The username

Returns:

Array:

The list of the authorized customer cards 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.

authorizeOpAdminQueuesUser

(
  • 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.

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.

authorizeOpExtensionsUser

(
  • username
)
Boolean

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

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 informations.

Parameters:

  • username String

    The username

Returns:

Boolean:

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

authorizeOpQueuesUser

(
  • username
)
Boolean

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

Parameters:

  • username String

    The username

Returns:

Boolean:

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

authorizeOpTrunksUser

(
  • username
)
Boolean

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

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.

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

(
  • data
)

Set configuration to use and initialize the user authorization.

The method can throw an Exception.

Parameters:

  • data Object
    • type String

      Authorization ini file path. The file must have the authorization name as section and 'users' key with the username list as value. In the case of customer card and streaming sections, the key is the name of customer card or video streaming.

configByFile

(
  • path
)
private

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

Parameters:

  • path String

    The path of the authorization 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

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.

getAuthorizedStreamingSources

(
  • username
)
Object

Returns all the authorized streaming sources of the user.

Parameters:

  • username String

    The username

Returns:

Object:

All the authorized streaming sources.

getUserAuthorizations

(
  • username
)
Object

Returns all authorizations of the user.

Parameters:

  • username String

    The username

Returns:

Object:

All authorizations of the user.

hasNoSpyEnabled

(
  • username
)
Boolean

Returns true if the specified user has the no spy permission enabled. In this case no user can spy the conversation of the specified user.

Parameters:

  • username String

    The username

Returns:

Boolean:

True if the user has the no spy permission enabled.

initializeEndpointsUsersByJSON

(
  • json
)
private

Sets the authorization to the user by json configuration.

Parameters:

  • json Object

    The JSON configuration

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.

setCompDbconn

(
  • comp
)
private

Set dbconn module to be used.

Parameters:

  • comp Object

    The dbconn 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.

setUserModule

(
  • module
)
private

Set user module to be used.

Parameters:

  • module Object

    The user module

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.

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

remoteOperatorsAutho

Object private

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

userMod

Object private

The user module.