mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2905] Updated JSDocs for content services (#3262)
* [ADF-2905] Updated JSDocs for content services * [ADF-2905] Updated JSDocs for content services * [ADF-2911] Improved error message handling in doc tools (#3267) * [ADF-2772] Sidenav Layout - UX review (#3264) * Add border-right in mat-sidenav * workaround for enum issue in js-api * fix the AoT buid error * fix AoT build error * fix export problem for AoT * [ADF-2905] Updated JSDocs for content services * [ADF-2905] Updated JSDocs for content services
This commit is contained in:
committed by
Eugenio Romano
parent
7f020348ad
commit
b393708514
@@ -29,9 +29,11 @@ import { NodePermissionService } from '../../services/node-permission.service';
|
||||
})
|
||||
export class PermissionListComponent implements OnInit {
|
||||
|
||||
/** ID of the node whose permissions you want to show. */
|
||||
@Input()
|
||||
nodeId: string = '';
|
||||
|
||||
/** Emitted when the permission is updated. */
|
||||
@Output()
|
||||
update: EventEmitter<PermissionElement> = new EventEmitter();
|
||||
|
||||
|
@@ -31,6 +31,11 @@ export class NodePermissionService {
|
||||
private nodeService: NodesApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of roles for the current node.
|
||||
* @param node The target node
|
||||
* @returns Array of strings representing the roles
|
||||
*/
|
||||
getNodeRoles(node: MinimalNodeEntryEntity): Observable<string[]> {
|
||||
const retrieveSiteQueryBody: QueryBody = this.buildRetrieveSiteQueryBody(node.path.elements);
|
||||
return this.searchApiService.searchByQueryBody(retrieveSiteQueryBody)
|
||||
@@ -44,7 +49,14 @@ export class NodePermissionService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the permission for a node.
|
||||
* @param node Target node
|
||||
* @param updatedPermissionRole Permission role to update or add
|
||||
* @returns Node with updated permission
|
||||
*/
|
||||
updatePermissionRole(node: MinimalNodeEntryEntity, updatedPermissionRole: PermissionElement): Observable<MinimalNodeEntryEntity> {
|
||||
|
||||
let permissionBody = { permissions: { locallySet: []} };
|
||||
const index = node.permissions.locallySet.map((permission) => permission.authorityId).indexOf(updatedPermissionRole.authorityId);
|
||||
permissionBody.permissions.locallySet = permissionBody.permissions.locallySet.concat(node.permissions.locallySet);
|
||||
@@ -109,6 +121,12 @@ export class NodePermissionService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all members related to a group name.
|
||||
* @param groupName Name of group to look for members
|
||||
* @param opts Extra options supported by JSAPI
|
||||
* @returns List of members
|
||||
*/
|
||||
getGroupMemeberByGroupName(groupName: string, opts?: any): Observable<GroupMemberPaging> {
|
||||
return Observable.fromPromise(this.apiService.groupsApi.getGroupMembers(groupName, opts));
|
||||
}
|
||||
|
Reference in New Issue
Block a user