Class

ActionDecorator

ActionDecorator(params)

Decorates an action

Constructor

# new ActionDecorator(params)

Parameters:
Name Type Description
params Object
action Action
resource BaseResource
admin AdminBro

current instance of AdminBro

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 19

Methods

# canInvokeAction(context) → {boolean}

Indicates if user can invoke given action

Parameters:
Name Type Description
context ActionContext

passed action context

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 134

when user cannot perform given action

true given user has rights to the action

boolean

# async handler(request, response, context) → {Promise.<any>}

Original handler wrapped with the hook before and after methods.

Parameters:
Name Type Description
request ActionRequest
response any
context ActionContext

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 42

Promise.<any>

# isAccessible(currentAdminopt, recordopt) → {Boolean}

Is action accessible

Parameters:
Name Type Attributes Description
currentAdmin CurrentAdmin <optional>

currently logged in admin user

record BaseRecord <optional>

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 123

Boolean

# isBulkType() → {Boolean}

Returns true when action can be performed on selected records

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 80

Boolean

# isRecordType() → {Boolean}

Returns true when action can be performed on a record

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 64

Boolean

# isResourceType() → {Boolean}

Returns true when action can be performed on an entire resource

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 72

Boolean

# isVisible(currentAdminopt, recordopt) → {Boolean}

Is action visible in the UI

Parameters:
Name Type Attributes Description
currentAdmin CurrentAdmin <optional>

currently logged in admin user

record BaseRecord <optional>

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 113

Boolean

# toJSON() → {ActionJSON}

Serializes action to JSON format

View Source admin-bro/src/backend/decorators/action-decorator.ts, line 163

serialized action

ActionJSON