Module

auth/viewAs

Allows dynamically to apply permissions for the specific role or user on CI level. It helps to admin user to see what user or role can do in the system.

View Source auth/view-as-actions.js, line 10

Methods

# static cancel()

Rejects all pending changes and closes popup.

Properties:
Name Type Description
type string

CANCEL

View Source auth/view-as-actions.js, line 22

# static changePristineState(pristine)

Changes the pristinity state of opened "View as" popup. Visually it is represented by asterisk on the title of modal dialog. If pristinity is false and user clicks on "Cancel", first confirmation will be asked before changes be lost.

Parameters:
Name Type Description
pristine boolean

the new pristinity value

Properties:
Name Type Description
type string

CHANGE_PRISTINE_STATE

View Source auth/view-as-actions.js, line 32

# static clear()

Removes selected role or user. What means that no permissions filtering happens anymore on CI level.

Properties:
Name Type Description
type string

CLEAR

View Source auth/view-as-actions.js, line 42

# static close()

Closes view as popup, changes pristinity to true. There is no check performed before closing popup whether user has pending changes or not. Use {cancel} for that.

Properties:
Name Type Description
type string

CLOSE

View Source auth/view-as-actions.js, line 50

# static refresh(data)

Applies permissions on CIs based on selected user/roles.

Parameters:
Name Type Description
data object

Object which contains selected user or roles. Represented as {user, roles}, where user is string and roles - array of strings.

Only one of fields should be defined.

Properties:
Name Type Description
type string

REFRESH

View Source auth/view-as-actions.js, line 60

# static setData(data)

Saves selected user or roles.

Parameters:
Name Type Description
data object

Object which contains selected user or roles. Represented as {user, roles}, where user is string and roles - array of strings.

Properties:
Name Type Description
type string

SET_DATA

View Source auth/view-as-actions.js, line 73

# static show()

Opens a "View as" modal dialog.

Properties:
Name Type Description
type string

SHOW

View Source auth/view-as-actions.js, line 82

# static stageData(data)

Saves typed in user's information in "View as" modal dialog but which is not saved yet.

Parameters:
Name Type Description
data object

Object which contains selected user or roles. Represented as {user, roles}, where user is string and roles - array of strings.

Properties:
Name Type Description
type string

SET_STAGED_DATA

View Source auth/view-as-actions.js, line 90