mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-21595] Content - Expose a group service for content (#5833)
* Expose a group service for content * Use nx command and remove smart-build
This commit is contained in:
18
lib/content-services/src/lib/group/index.ts
Normal file
18
lib/content-services/src/lib/group/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
18
lib/content-services/src/lib/group/public-api.ts
Normal file
18
lib/content-services/src/lib/group/public-api.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './services/group.service';
|
43
lib/content-services/src/lib/group/services/group.service.ts
Normal file
43
lib/content-services/src/lib/group/services/group.service.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GroupEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class GroupService {
|
||||
constructor(
|
||||
private alfrescoApiService: AlfrescoApiService
|
||||
) {}
|
||||
|
||||
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
||||
const groupsPaginated = await this.alfrescoApiService.groupsApi.listGroupMembershipsForPerson(personId, opts);
|
||||
accumulator = [...accumulator, ...groupsPaginated.list.entries];
|
||||
if (groupsPaginated.list.pagination.hasMoreItems) {
|
||||
const skip = groupsPaginated.list.pagination.skipCount + groupsPaginated.list.pagination.count;
|
||||
return this.listAllGroupMembershipsForPerson(personId, {
|
||||
maxItems: opts.maxItems,
|
||||
skipCount: skip
|
||||
}, accumulator);
|
||||
} else {
|
||||
return accumulator;
|
||||
}
|
||||
}
|
||||
}
|
@@ -179,7 +179,7 @@ export class NodePermissionService {
|
||||
* @returns List of members
|
||||
*/
|
||||
getGroupMemberByGroupName(groupName: string, opts?: any): Observable<GroupMemberPaging> {
|
||||
return from(this.apiService.groupsApi.getGroupMembers(groupName, opts));
|
||||
return from(this.apiService.groupsApi.listGroupMemberships(groupName, opts));
|
||||
}
|
||||
|
||||
private formattedRoleName(displayName, siteName): string {
|
||||
|
@@ -32,5 +32,6 @@ export * from './lib/content-metadata/index';
|
||||
export * from './lib/permission-manager/index';
|
||||
export * from './lib/content-node-share/index';
|
||||
export * from './lib/tree-view/index';
|
||||
export * from './lib/group/index';
|
||||
|
||||
export * from './lib/content.module';
|
||||
|
Reference in New Issue
Block a user