The IpCanPipe is a pipe that checks if the end user can or cannot perform an action based on the AIPEmailBuilderMiddlewareService.can method.
This method checks if the end user can or cannot perform an action based on the middleware's
entity— The email builder entity object. It can be of type
action— The action to be performed. It can be of type
- A boolean value that indicates whether the user can perform the specified action on the given entity.
Here's an example:
<div *ngIf="block | ipCan: 'delete'">
<button (click)="onDeleteBlock()">Delete Block</button>
In this example, the
*ngIfdirective uses the
IpCanPipeto check if the current user has permission to delete the
blockcomponent. If the user has permission, the delete button is displayed. If not, the button is hidden.