API Docs for: 0.8.0
Show:

SecurityService Class

Module: Security
Parent Module: Services

Service for managing user access

Methods

authenticateSession

(
  • session
  • options
  • authenticator
  • cb
)
static

Authenticates a session

Parameters:

  • session Object
  • options Object
  • authenticator Authentication
  • cb Function

encrypt

(
  • valStr #return
)

One way encrypt a string

Parameters:

  • valStr #return String

    {String} Encrypted string

generatePassword

(
  • [length=8]
)
static

Parameters:

  • [length=8] Integer optional

getPrincipal

(
  • session
)
Object static

Parameters:

  • session Object

Returns:

Object:

The authenticated user principal or NULL if not authenticated

getRoleName

(
  • accessLevel
)

Returns the constant name of an access level number

Parameters:

  • accessLevel Number

getRoleNames

(
  • ls
)
Array

Retrieves the localized names of access levels as an array

Parameters:

Returns:

Array:

getRoleToDisplayNameMap

(
  • ls
)
Object static

Provides a hash of the default roles to their translated display name

Parameters:

Returns:

Object:

isAuthenticated

(
  • session
)

Check to see if a session is authentic

Parameters:

  • session Object

isAuthorized

(
  • session
  • requirements
)
static

Check to see if a user meets security requirements

Parameters:

  • session Object

    [description]

  • requirements Object

    Object containing access requirements

Properties

ACCESS_

Integer static

ACCESS_

Integer static

ACCESS_ADMINISTRATOR

Integer static

ACCESS_EDITOR

Integer static

ACCESS_MANAGING_EDITOR

Integer static

ACCESS_USER

Integer static

ACCESS_WRITER

Integer static

PASSWORD_CHARS

Array private static

ROLE_VAL_TO_NAME

Array private static

SYSTEM_ROLES

Array static

Provides an array of all of the system roles. It provides their numeric value as well as the unique string key