2021-04-09 13:46:53 +02:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
2021-08-12 15:04:37 +02:00
|
|
|
import { AccessService } from '../../lib/services/access-service';
|
2021-04-22 23:40:52 +02:00
|
|
|
import User from '../../lib/types/user';
|
2021-04-09 13:46:53 +02:00
|
|
|
import noLoggerProvider from './no-logger';
|
2021-08-12 15:04:37 +02:00
|
|
|
import { IRole } from '../../lib/types/stores/access-store';
|
2022-01-13 11:14:17 +01:00
|
|
|
import {
|
|
|
|
IAvailablePermissions,
|
|
|
|
IRoleData,
|
|
|
|
IUserWithRole,
|
|
|
|
} from '../../lib/types/model';
|
2021-04-09 13:46:53 +02:00
|
|
|
|
|
|
|
class AccessServiceMock extends AccessService {
|
|
|
|
constructor() {
|
|
|
|
super(
|
2022-01-13 11:14:17 +01:00
|
|
|
{
|
|
|
|
accessStore: undefined,
|
|
|
|
userStore: undefined,
|
|
|
|
roleStore: undefined,
|
|
|
|
environmentStore: undefined,
|
|
|
|
},
|
2021-04-09 13:46:53 +02:00
|
|
|
{ getLogger: noLoggerProvider },
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
hasPermission(
|
|
|
|
user: User,
|
|
|
|
permission: string,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<boolean> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
getPermissions(): Promise<IAvailablePermissions> {
|
2021-04-09 13:46:53 +02:00
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
addUserToRole(userId: number, roleId: number): Promise<void> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
setUserRootRole(userId: number, roleId: number): Promise<void> {
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
|
|
|
addPermissionToRole(
|
|
|
|
roleId: number,
|
|
|
|
permission: string,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<void> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
removePermissionFromRole(
|
|
|
|
roleId: number,
|
|
|
|
permission: string,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<void> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
getRoles(): Promise<IRole[]> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
getRolesForProject(projectId: string): Promise<IRole[]> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
getRolesForUser(userId: number): Promise<IRole[]> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
getUsersForRole(roleId: any): Promise<User[]> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
getProjectRoleUsers(
|
|
|
|
projectId: string,
|
|
|
|
): Promise<[IRole[], IUserWithRole[]]> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
createDefaultProjectRoles(owner: User, projectId: string): Promise<void> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
|
|
|
|
removeDefaultProjectRoles(owner: User, projectId: string): Promise<void> {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AccessServiceMock;
|