Namespace: auth

auth

Authorization adaptation classes.

Version:
  • 0.9.0
Author:
  • Serban Petrescu
Source:

Classes

ControlIterator
Factory

Namespaces

action
helper
selector

Methods


buildContext(aActions, mRoles)

Builds a processing context. A context is a map between the view name and
the selectors & actions linked to that view.

Parameters:
Name Type Description
aActions Array.<object>

An array of action specifications.

mRoles object

A map between the role name and a
flag indicating if the current user has this role.

Source:
Returns:

A map between the view name and an array of action
and selector pairs.

Type
object

buildRoleMap(oSpec, aROles)

Utility method for computing the complete role map based on a role specification
and the list of roles that the current user has.

Parameters:
Name Type Description
oSpec object

The role configuration specification.

Properties
Name Type Argument Description
roles Array.<string>

The list of design-time roles.

implications object <optional>

An optional map between the name of
a role and a string array with the roles which derive (are implied) by that role.

expressions object <optional>

An optional map between the name of
a role and an expression which can be used to compute that role.

aROles Array.<string>

The roles which the current user has.

Source:
Returns:

A map between the role name and the role's state.

Type
object

processControlTree(sComponentId, oView, oRoot)

Processes a control tree by applying the actions in the context
for the owner component. The processing is asynchronous (if the
authorization specification and role list were already retrieved,
then the processing is done immeiately).

Parameters:
Name Type Description
sComponentId string

The owner component's ID.

oView sap.ui.mvc.View

The parent view (which may
or may not coincide with the root control).

oRoot sap.ui.core.Element

The root of the tree.

Source:
Returns:

A promise which is resolved when the tree processing
was finished.

Type
Promise

registerComponent(sComponentId, oSpec, aRoles)

Registers a component for processing. If this is the first component
registered, then the global XML view processor is also registered.

Parameters:
Name Type Description
sComponentId string

The component's ID.

oSpec object | string | deferred

The authorization spec.
Can either be passed directly as a JS object, as a path string (which
is used to trigger a GET request) or as a promise which resolves with
the object.

aRoles Array.<string> | string | deferred

The current user's roles.
Can either be passed directly as a JS object, as a path string (which
is used to trigger a GET request) or as a promise which resolves with
the roles.

Source:
Returns:
Type
void