[ADF-2824] Added and reviewed some content services docs (#3385)

This commit is contained in:
Andy Stark
2018-05-23 19:35:19 +01:00
committed by Eugenio Romano
parent 41777e0540
commit 591bec5bdd
7 changed files with 99 additions and 21 deletions

View File

@@ -31,6 +31,12 @@ export class NodePermissionDialogService {
private nodePermissionService: NodePermissionService) {
}
/**
* Opens a dialog to add permissions to a node.
* @param nodeId ID of the target node
* @param title Dialog title
* @returns Node with updated permissions
*/
openAddPermissionDialog(nodeId: string, title?: string): Observable<MinimalNodeEntity[]> {
const confirm = new Subject<MinimalNodeEntity[]>();
@@ -52,10 +58,19 @@ export class NodePermissionDialogService {
this.dialog.open(AddPermissionDialogComponent, { data, panelClass: currentPanelClass, width: chosenWidth });
}
/**
* Closes the currently-open dialog.
*/
close() {
this.dialog.closeAll();
}
/**
* Opens a dialog to update permissions for a node.
* @param nodeId ID of the target node
* @param title Dialog title
* @returns Node with updated permissions
*/
updateNodePermissionByDialog(nodeId?: string, title?: string): Observable<MinimalNodeEntryEntity> {
return this.openAddPermissionDialog(nodeId, title).switchMap((selection) => {
return this.nodePermissionService.updateNodePermissions(nodeId, selection);