Reference Source
public class | source

AuthorizationManager

Extends:

devapt-core-common/dist/js/base/errorable~ErrorablePluginsManager → AuthorizationManager

Authorization class to manage authorization plugins.

Constructor Summary

Public Constructor
public

constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing

Create an Authorization manager class.

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

authorize(arg_permission: object, arg_credentials: Credentials): object

Chech permission authorization of a user.

public

error_bad_plugin(arg_plugin_mode: string): nothing

Error wrapper - error during plugin loading.

public

load(arg_settings: object): nothing

Load security settings

public

load_plugin(arg_settings: object): boolean

Load security plugin from settings.

Inherited Summary

From class PluginsManager
public
public
public
private
public

enabled_plugin(arg_name: string): Plugin

Get a enabled plugin by its name.

public

error_already_registered(arg_plugin_name: string): nothing

Error wrapper - on registering an already registered plugin

public

error_not_registered(arg_plugin_name: string): nothing

Error wrapper - a plugin is not registered

public

Get class name.

public

get_plugins(): array

Get registered plugins list.

public
public

get_typed_plugins(arg_type_or_types: string | array): array

Get registered plugins list with a filtered type.

public

load(arg_plugins: array): nothing

Load a map of plugins.

public

load_at_first(arg_plugin: Plugin): nothing

Load plugin at first position

public

plugin(arg_name: string, arg_enabled: boolean): Plugin

Get a registered plugin by its name and its enabled flag.

public

register_plugin(arg_plugin: object, arg_position: integer): object

Register a plugin to be used later, do not active it now.

public

registered_plugin(arg_name: string): Plugin

Get a registered plugin by its name.

public

Unregister a registered plugin and disble it before if needed.

Public Constructors

public constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing source

Create an Authorization manager class.

Override:

PluginsManager#constructor

Params:

NameTypeAttributeDescription
arg_runtime RuntimeBase

runtime.

arg_log_context string | undefined

optional.

arg_logger_manager LoggerManager

logger manager object (optional).

Return:

nothing

Public Members

public authorization_is_enabled: boolean source

public authorization_mode: * source

public is_authorization_manager: boolean source

Public Methods

public authorize(arg_permission: object, arg_credentials: Credentials): object source

Chech permission authorization of a user.

Params:

NameTypeAttributeDescription
arg_permission object

permission plain object.

arg_credentials Credentials

user credentials plain object.

Return:

object

a promise of boolean

public error_bad_plugin(arg_plugin_mode: string): nothing source

Error wrapper - error during plugin loading.

Params:

NameTypeAttributeDescription
arg_plugin_mode string

plugin mode

Return:

nothing

public load(arg_settings: object): nothing source

Load security settings

Override:

PluginsManager#load

Params:

NameTypeAttributeDescription
arg_settings object

authorization settings (Immutable object)

Return:

nothing

public load_plugin(arg_settings: object): boolean source

Load security plugin from settings.

Params:

NameTypeAttributeDescription
arg_settings object

authorization settings (Immutable object).

Return:

boolean