Files
alfresco-ng2-components/ng2-components/ng2-alfresco-core/src/directives/node-permission.md
Eugenio Romano 56e65cd652 [ADF-1095] Date Range picker remains on screen remove md-data-picker (#2190)
* [ADF-1095] Date Range picker remains on screen

* created date widget component  with md datepicker.

* [ADF-1095] Date Range picker remains on screen.

* Changed mdl date picker to md date picker.
* Updated en.josn with new fields.
* Added md libraires to  spec files .

* [ADF-1095] Date Range picker remains on screen

* Removed old id's for start and end date inputs.

* remove md-date-time-picker

* use local MaterialModule in test

* [activiti-analytics] remove encapsulation and fix test

* remove from vendor md-date-time-picker
2017-09-05 15:16:41 +01:00

1.5 KiB

Node Permission Directive

The NodePermissionDirective allows you to disable an HTML element or Angular component by taking a collection of the MinimalNodeEntity instances and checking the particular permission.

The decorated element will be disabled if:

  • there are no nodes in the collection
  • at least one of the nodes has no expected permission

Basic example

The best example to show NodePermissionDirective in action is by binding DocumentList selection property to a toolbar button.

For example the "Delete" button should be disabled if no selection is present or if user has no rights to delete at least one node in the selection.

<adf-toolbar title="toolbar example">
    <button md-icon-button
            adf-node-permission="delete"
            [adf-nodes]="documentList.selection">
        <md-icon>delete</md-icon>
    </button>
</adf-toolbar>

<adf-document-list #documentList ...>
 ...
</adf-document-list>

The button will become disabled by default, and is going to change its state once user selects/unselects one or multiple documents that current user has permission to delete.

Properties

Name Type Default Description
adf-node-permission Permissions null Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions)
adf-nodes MinimalNodeEntity[] [] Nodes to check permission for