mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4152] Restructured Content Services docs (#4429)
* [ADF-4152] Moved content services docs to subfolders * [ADF-4152] Manual URL fixes for cont services docs * [ADF-4152] Moved content services docs to subfolders * [ADF-4152] Manual URL fixes for cont services docs * [ADF-4152] Updated doc index pages for content services
This commit is contained in:
committed by
Eugenio Romano
parent
bc5208b767
commit
dfea5c2f04
@@ -0,0 +1,58 @@
|
||||
---
|
||||
Title: Add Permission Dialog Component
|
||||
Added: v2.4.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-11-13
|
||||
---
|
||||
|
||||
# [Add Permission Dialog Component](../../../lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.ts "Defined in add-permission-dialog.component.ts")
|
||||
|
||||
Displays a dialog to search for people or groups to add to the current node permissions.
|
||||
|
||||

|
||||
|
||||
## Basic Usage
|
||||
|
||||
```ts
|
||||
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
|
||||
|
||||
constructor(private nodePermissionDialogService: nodePermissionDialogService) {
|
||||
}
|
||||
|
||||
this.nodePermissionDialogService.openAddPermissionDialog(this.nodeId).subscribe((selectedNodes) => {
|
||||
//action for selected nodes
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
```
|
||||
|
||||
## Details
|
||||
|
||||
This component extends the [Add permission panel component](add-permission-panel.component.md)
|
||||
to apply the chosen selection of permissions when they are accepted.
|
||||
You can open the dialog with the `openAddPermissionDialog` method from the
|
||||
[Node Permission Dialog Service](../services/node-permission-dialog.service.md).
|
||||
This returns an [`Observable`](http://reactivex.io/documentation/observable.html)
|
||||
that you can subscribe to so you can get the details of the node after the update.
|
||||
Use the `updateNodePermissionByDialog` nethod from the service to update node permissions, as shown in
|
||||
the following example:
|
||||
|
||||
```ts
|
||||
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
|
||||
|
||||
constructor(private nodePermissionDialogService: nodePermissionDialogService) {
|
||||
}
|
||||
|
||||
this.nodePermissionDialogService.updateNodePermissionByDialog(this.nodeId).subscribe((node) => {
|
||||
//updated node
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Node permission dialog service](../services/node-permission-dialog.service.md)
|
||||
- [Add permission panel component](add-permission-panel.component.md)
|
Reference in New Issue
Block a user