Constructor
# new ActionDecorator(params)
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | |
action |
Action | |
resource |
BaseResource | |
admin |
AdminBro | current instance of AdminBro |
Methods
# async handler(request, response, data) → {Promise.<any>}
Original handler wrapped with the hook before
and after
methods.
Parameters:
Name | Type | Description |
---|---|---|
request |
ActionRequest | |
response |
any | |
data |
ActionContext |
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> |
Boolean
# isResourceType() → {Boolean}
Returns true when action can be performed on an entire resource
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> |
Boolean