IpCanPipe
Methods
transform()
This method checks if the end user can or cannot perform an action based on the middleware’s can
method.
Parameters:
entity
— The email builder entity object. It can be of typeAIPEmailBuilderBlockExtendedOptions
,IStructure
, orIPEmail
.action
— The action to be performed. It can be of typemiddlewareBlockActions
,middlewareStructureActions
, ormiddlewareEmailActions
.
Returns:
- A boolean value that indicates whether the user can perform the specified action on the given entity.
Usage
Here’s an example:
In this example, the *ngIf
directive uses the IpCanPipe
to check if the current user has permission to delete the block
component. If the user has permission, the delete button is displayed. If not, the button is hidden.