- Log in to the Delegated Administration Dashboard.
- Click on your name in the top-right corner. You’ll see a dropdown menu; click on the Configure option.
Extension Hooks Context
The context (ctx) object will expose a few helpers and information about the current request. The following methods and properties are available in every Extension Hook:- Logging
- Caching
- Custom Data
- Payload and Request
- Remote Calls
Logging
To add a message to the Webtask logs (which you can view using the Realtime Webtask Logs extension), call the log method:Caching
To cache something (such as a long list of departments), you can store it on the context’s global object. This object will be available until the Webtask container recycles.Custom data
You can store custom data within the extension. This field is limited to 400kb of data.Payload and request
Each Extension Hook exposes the current payload or request with specific information. The request will always contain information about the user that is logged into the Users Dashboard:Remote calls
If you want to call an external service (such as an API) to validate data or to load memberships, you can do this using therequest
module.
Hook contract
-
ctx
: The context object-
payload
: The payload objectaction
: The current action (for example,delete:user
) that is being executeduser
: The user on which the action is being executed
-
-
callback(error)
: The callback to which you can return an error if access is denied
Sample use
Kelly manages the Finance department, and she should only be able to access users within her department.read:user
delete:user
reset:password
change:password
change:username
change:email
read:devices
read:logs
remove:multifactor-provider
block:user
unblock:user
send:verification-email