Skip to main content

Notification Access Control Hook

The notification access control hook is in charge of adding new access control notifications for one or more users, after an access request action is triggered. However, remember that hooks and actions are not necessarily related to each other, so this hook could be linked also to other custom actions.

Adding a Notification Access Control hook to an Action

If you want to add the Notification Access Control hook to an action, you can place the hook under the hooks property in the app-config. Example on how to add this hook to the Access Request\ action:

# in app-config.yaml
actionHandlers:
accessRequest:
invokeUpdateAcl: true
onFailure:
retries: 3
polling:
interval: 30000
timeout: 180000
updateAclUrl: http://<coordinator url>/datamesh.provisioningcoordinator/v1/updateacl
getExecutionPlanStatusUrl: http://<coordinator url>/datamesh.provisioningcoordinator/v1/execution-plans/{{planId}}/status
hooks:
- type: notificationAccessControl

This will add to the accessRequest action, the notificationAccessControl hook. Of course if you want to attach it to another action, just change accessRequest with another one.

Result of the hook

As we mentioned above, this hook will add a request notification to the target user(s), that they must either accept or reject. To see how witboost is displaying these notifications, you can navigate to the Access Control Notifications Requests section. In conclusion, this hook is only in charge of adding the notification to be displayed as in the linked section. After this hook returns, it also saves the notification id to the hooks table as response. As soon as the user accept/reject the notification, that response put in the table is updated accordingly.