mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-9377] remove the join button for records management library for user s without permissions for that library (#10901)
* [ACS-9377] Added function for file plans to get file plan roles * [ACS-9377] Types and documentation * [ACS-9377] Unit tests * [ACS-9377] Fixed sonar cloud issue
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { BaseMock } from '../base.mock';
|
||||
import nock from 'nock';
|
||||
import { FilePlanRolePaging } from '@alfresco/js-api';
|
||||
|
||||
export class FilePlansMock extends BaseMock {
|
||||
get200FilePlanRoles(filePlanId: string): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get(`/alfresco/api/-default-/public/gs/versions/1/file-plans/${filePlanId}/roles`)
|
||||
.query({})
|
||||
.reply(200, this.mockFilePlanRolePaging());
|
||||
}
|
||||
|
||||
get200FilePlanRolesWithFilteringByCapabilityNames(filePlanId: string): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get(`/alfresco/api/-default-/public/gs/versions/1/file-plans/${filePlanId}/roles`)
|
||||
.query({
|
||||
where: "(capabilityName in ('capability1', 'capability2'))"
|
||||
})
|
||||
.reply(200, this.mockFilePlanRolePaging());
|
||||
}
|
||||
|
||||
private mockFilePlanRolePaging(): FilePlanRolePaging {
|
||||
return {
|
||||
list: {
|
||||
pagination: {
|
||||
count: 2,
|
||||
hasMoreItems: false,
|
||||
totalItems: 2,
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
},
|
||||
entries: [
|
||||
{
|
||||
entry: {
|
||||
displayLabel: 'Role One',
|
||||
groupShortName: 'group short name 1',
|
||||
name: 'role1',
|
||||
roleGroupName: 'role group name 1',
|
||||
capabilities: [
|
||||
{
|
||||
index: 0,
|
||||
name: 'capability1',
|
||||
title: 'Capability One',
|
||||
group: {
|
||||
id: 'group1',
|
||||
title: 'Group One'
|
||||
}
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
name: 'capability2',
|
||||
title: 'Capability Two',
|
||||
group: {
|
||||
id: 'group2',
|
||||
title: 'Group Two'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
entry: {
|
||||
displayLabel: 'Role Two',
|
||||
groupShortName: 'group short name 2',
|
||||
name: 'role2',
|
||||
roleGroupName: 'role group name 2',
|
||||
capabilities: [
|
||||
{
|
||||
index: 0,
|
||||
name: 'capability3',
|
||||
title: 'Capability Three',
|
||||
group: {
|
||||
id: 'group3',
|
||||
title: 'Group Three'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user