security

security

security

Encapsulates the generic higher-level security functions and variables

Metadata

authenticate()

Attempts to authenticate a user using each directory, and returns true if successful

Arguments

Name Type Required Default Options Description
None

checkPermission()

Returns true if a user has the specified permission

Arguments

Name Type Required Default Options Description
permission string No The permission to check
object string No If specified, will check barnacle
role string No List of roles to check
type string No The type for the webskin to check
webskin string No The webskin or permission set to check

deleteCache()

Deletes the specified cache. Doesn't error check.

Arguments

Name Type Required Default Options Description
role uuid Yes The role to find
permission string No The permission to find
object string No The object to find
webskin string No The webskin to cache

getAllUD()

Returns a list of the user directories this application supports

Arguments

Name Type Required Default Options Description
None

getCache()

Returns the cached right. Doesn't error check.

Arguments

Name Type Required Default Options Description
role uuid Yes The role to retrieve
permission uuid No The permission to retrieve
object string No The object to retrieve
webskin string No The webskin to cache

getCurrentRoles()

Returns the roles of the current logged in user

Arguments

Name Type Required Default Options Description
None

getCurrentUD()

Returns the UD of the current user

Arguments

Name Type Required Default Options Description
None

getCurrentUserID()

Returns the id of the current user

Arguments

Name Type Required Default Options Description
None

getDefaultUD()

Returns the default user directory for this application

Arguments

Name Type Required Default Options Description
None

getGroupUsers()

Returns an array of the members of the specified groups

Arguments

Name Type Required Default Options Description
groups any Yes The list or array of groups

getLoginForm()

Returns the name of the login form component for the specified user directory

Arguments

Name Type Required Default Options Description
ud string Yes The user directory to query

getLookup()

Returns the objectid for a specified label

Arguments

Name Type Required Default Options Description
role string No The title of the role to lookup
permission string No The title of the permission to lookup

getUsers()

Returns a list of the users that have this permission

Arguments

Name Type Required Default Options Description
permission uuid Yes The permission to query

hasLookup()

Returns true if the lookup is cached

Arguments

Name Type Required Default Options Description
role string No The title of the role to lookup
permission string No The title of the permission to lookup

hasRole()

Returns true if the current user has the specified role

Arguments

Name Type Required Default Options Description
role string No Roles to check

init()

Initialises and returns the security scope component

Arguments

Name Type Required Default Options Description
None

initCache()

Initialises the security cache

Arguments

Name Type Required Default Options Description
None

initRequestMode()

Sets up the request.mode struct and other request settings based on the current users security permissions

Arguments

Name Type Required Default Options Description
stURL struct Yes [runtime expression] Reference to the URL struct

isCached()

Returns true if the right is cached

Arguments

Name Type Required Default Options Description
role uuid Yes The role to find
permission uuid No The permission to find
object string No The object to find
webskin string No The webskin to cache

isLoggedIn()

Returns true if a user has logged in.

Arguments

Name Type Required Default Options Description
None

login()

Logs in the specified user

Arguments

Name Type Required Default Options Description
userid string Yes The UD specific user id
ud string Yes The user directory

logout()

Arguments

Name Type Required Default Options Description
None

onRequestStart()

This function should be executed on page request start

Arguments

Name Type Required Default Options Description
None

processLogin()

Attempts to authenticate a login and if unsuccessful, sets up any subsequent login forms for the page. Returns a struct containing all the nessesary information for a user directories login form.

Arguments

Name Type Required Default Options Description
None

removeLookup()

Removes the specified objectid or label

Arguments

Name Type Required Default Options Description
role string No The title of the role to lookup
permission string No The title of the permission to lookup

setCache()

Sets up the ermission cache structure

Arguments

Name Type Required Default Options Description
role uuid Yes The role to cache
permission uuid No The permission to cache
object string No The object to cache
webskin string No The webskin to cache
right numeric Yes The right value to cache

setLookup()

Stores an objectid for a specified label

Arguments

Name Type Required Default Options Description
role string No The title of the role to lookup
permission string No The title of the permission to lookup
objectid uuid Yes The objectid of the item to store