2021-03-11 22:51:58 +01:00
|
|
|
import { EventEmitter } from 'events';
|
2021-03-23 12:43:33 +01:00
|
|
|
import { Knex } from 'knex';
|
2021-05-02 21:11:17 +02:00
|
|
|
import metricsHelper from '../util/metrics-helper';
|
2021-04-29 10:21:29 +02:00
|
|
|
import { DB_TIME } from '../metric-events';
|
2021-08-12 15:04:37 +02:00
|
|
|
import { Logger } from '../logger';
|
|
|
|
import {
|
2022-07-21 16:23:56 +02:00
|
|
|
IAccessInfo,
|
2021-08-12 15:04:37 +02:00
|
|
|
IAccessStore,
|
|
|
|
IRole,
|
2022-09-30 13:36:45 +02:00
|
|
|
IRoleWithProject,
|
2021-08-12 15:04:37 +02:00
|
|
|
IUserPermission,
|
2022-07-21 16:23:56 +02:00
|
|
|
IUserRole,
|
2021-08-12 15:04:37 +02:00
|
|
|
} from '../types/stores/access-store';
|
2022-01-13 11:14:17 +01:00
|
|
|
import { IPermission } from '../types/model';
|
|
|
|
import NotFoundError from '../error/notfound-error';
|
|
|
|
import {
|
|
|
|
ENVIRONMENT_PERMISSION_TYPE,
|
|
|
|
ROOT_PERMISSION_TYPE,
|
|
|
|
} from '../util/constants';
|
2021-03-11 22:51:58 +01:00
|
|
|
|
|
|
|
const T = {
|
|
|
|
ROLE_USER: 'role_user',
|
|
|
|
ROLES: 'roles',
|
2022-07-21 16:23:56 +02:00
|
|
|
GROUPS: 'groups',
|
|
|
|
GROUP_ROLE: 'group_role',
|
|
|
|
GROUP_USER: 'group_user',
|
2021-03-11 22:51:58 +01:00
|
|
|
ROLE_PERMISSION: 'role_permission',
|
2022-01-13 11:14:17 +01:00
|
|
|
PERMISSIONS: 'permissions',
|
|
|
|
PERMISSION_TYPES: 'permission_types',
|
2022-11-14 14:05:26 +01:00
|
|
|
CHANGE_REQUEST_SETTINGS: 'change_request_settings',
|
2021-03-11 22:51:58 +01:00
|
|
|
};
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
interface IPermissionRow {
|
|
|
|
id: number;
|
|
|
|
permission: string;
|
|
|
|
display_name: string;
|
|
|
|
environment?: string;
|
|
|
|
type: string;
|
|
|
|
project?: string;
|
|
|
|
role_id: number;
|
|
|
|
}
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
export class AccessStore implements IAccessStore {
|
|
|
|
private logger: Logger;
|
2021-03-11 22:51:58 +01:00
|
|
|
|
|
|
|
private timer: Function;
|
|
|
|
|
|
|
|
private db: Knex;
|
|
|
|
|
2022-08-26 08:22:42 +02:00
|
|
|
constructor(db: Knex, eventBus: EventEmitter, getLogger: Function) {
|
2021-03-11 22:51:58 +01:00
|
|
|
this.db = db;
|
2021-08-12 15:04:37 +02:00
|
|
|
this.logger = getLogger('access-store.ts');
|
2021-03-11 22:51:58 +01:00
|
|
|
this.timer = (action: string) =>
|
|
|
|
metricsHelper.wrapTimer(eventBus, DB_TIME, {
|
|
|
|
store: 'access-store',
|
|
|
|
action,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
async delete(key: number): Promise<void> {
|
|
|
|
await this.db(T.ROLES).where({ id: key }).del();
|
|
|
|
}
|
|
|
|
|
|
|
|
async deleteAll(): Promise<void> {
|
|
|
|
await this.db(T.ROLES).del();
|
|
|
|
}
|
|
|
|
|
|
|
|
destroy(): void {}
|
|
|
|
|
|
|
|
async exists(key: number): Promise<boolean> {
|
|
|
|
const result = await this.db.raw(
|
2022-07-21 16:23:56 +02:00
|
|
|
`SELECT EXISTS(SELECT 1 FROM ${T.ROLES} WHERE id = ?) AS present`,
|
2021-08-12 15:04:37 +02:00
|
|
|
[key],
|
|
|
|
);
|
|
|
|
const { present } = result.rows[0];
|
|
|
|
return present;
|
|
|
|
}
|
|
|
|
|
|
|
|
async get(key: number): Promise<IRole> {
|
2022-01-13 11:14:17 +01:00
|
|
|
const role = await this.db
|
2021-08-12 15:04:37 +02:00
|
|
|
.select(['id', 'name', 'type', 'description'])
|
|
|
|
.where('id', key)
|
|
|
|
.first()
|
|
|
|
.from<IRole>(T.ROLES);
|
2022-01-13 11:14:17 +01:00
|
|
|
|
|
|
|
if (!role) {
|
|
|
|
throw new NotFoundError(`Could not find role with id: ${key}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
return role;
|
2021-08-12 15:04:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async getAll(): Promise<IRole[]> {
|
|
|
|
return Promise.resolve([]);
|
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async getAvailablePermissions(): Promise<IPermission[]> {
|
|
|
|
const rows = await this.db
|
|
|
|
.select(['id', 'permission', 'type', 'display_name'])
|
|
|
|
.where('type', 'project')
|
|
|
|
.orWhere('type', 'environment')
|
|
|
|
.from(`${T.PERMISSIONS} as p`);
|
|
|
|
return rows.map(this.mapPermission);
|
|
|
|
}
|
|
|
|
|
|
|
|
mapPermission(permission: IPermissionRow): IPermission {
|
|
|
|
return {
|
|
|
|
id: permission.id,
|
|
|
|
name: permission.permission,
|
|
|
|
displayName: permission.display_name,
|
|
|
|
type: permission.type,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-04-12 20:25:03 +02:00
|
|
|
async getPermissionsForUser(userId: number): Promise<IUserPermission[]> {
|
2021-03-11 22:51:58 +01:00
|
|
|
const stopTimer = this.timer('getPermissionsForUser');
|
2022-07-21 16:23:56 +02:00
|
|
|
let userPermissionQuery = this.db
|
2022-01-13 11:14:17 +01:00
|
|
|
.select(
|
|
|
|
'project',
|
|
|
|
'permission',
|
|
|
|
'environment',
|
|
|
|
'type',
|
|
|
|
'ur.role_id',
|
|
|
|
)
|
|
|
|
.from<IPermissionRow>(`${T.ROLE_PERMISSION} AS rp`)
|
|
|
|
.join(`${T.ROLE_USER} AS ur`, 'ur.role_id', 'rp.role_id')
|
|
|
|
.join(`${T.PERMISSIONS} AS p`, 'p.id', 'rp.permission_id')
|
2021-04-12 20:25:03 +02:00
|
|
|
.where('ur.user_id', '=', userId);
|
2022-07-21 16:23:56 +02:00
|
|
|
|
2022-08-26 08:22:42 +02:00
|
|
|
userPermissionQuery = userPermissionQuery.union((db) => {
|
|
|
|
db.select(
|
|
|
|
'project',
|
|
|
|
'permission',
|
|
|
|
'environment',
|
|
|
|
'p.type',
|
|
|
|
'gr.role_id',
|
|
|
|
)
|
|
|
|
.from<IPermissionRow>(`${T.GROUP_USER} AS gu`)
|
|
|
|
.join(`${T.GROUPS} AS g`, 'g.id', 'gu.group_id')
|
|
|
|
.join(`${T.GROUP_ROLE} AS gr`, 'gu.group_id', 'gr.group_id')
|
|
|
|
.join(`${T.ROLE_PERMISSION} AS rp`, 'rp.role_id', 'gr.role_id')
|
|
|
|
.join(`${T.PERMISSIONS} AS p`, 'p.id', 'rp.permission_id')
|
|
|
|
.where('gu.user_id', '=', userId);
|
|
|
|
});
|
2022-07-21 16:23:56 +02:00
|
|
|
const rows = await userPermissionQuery;
|
2021-03-11 22:51:58 +01:00
|
|
|
stopTimer();
|
2022-01-13 11:14:17 +01:00
|
|
|
return rows.map(this.mapUserPermission);
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
mapUserPermission(row: IPermissionRow): IUserPermission {
|
|
|
|
let project: string = undefined;
|
|
|
|
// Since the editor should have access to the default project,
|
|
|
|
// we map the project to the project and environment specific
|
|
|
|
// permissions that are connected to the editor role.
|
|
|
|
if (row.type !== ROOT_PERMISSION_TYPE) {
|
|
|
|
project = row.project;
|
|
|
|
}
|
2021-03-11 22:51:58 +01:00
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
const environment =
|
|
|
|
row.type === ENVIRONMENT_PERMISSION_TYPE
|
|
|
|
? row.environment
|
|
|
|
: undefined;
|
2021-03-11 22:51:58 +01:00
|
|
|
|
2022-07-21 16:23:56 +02:00
|
|
|
return {
|
2022-01-13 11:14:17 +01:00
|
|
|
project,
|
|
|
|
environment,
|
|
|
|
permission: row.permission,
|
|
|
|
};
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async getPermissionsForRole(roleId: number): Promise<IPermission[]> {
|
|
|
|
const stopTimer = this.timer('getPermissionsForRole');
|
|
|
|
const rows = await this.db
|
|
|
|
.select(
|
|
|
|
'p.id',
|
|
|
|
'p.permission',
|
|
|
|
'rp.environment',
|
|
|
|
'p.display_name',
|
|
|
|
'p.type',
|
|
|
|
)
|
|
|
|
.from<IPermission>(`${T.ROLE_PERMISSION} as rp`)
|
|
|
|
.join(`${T.PERMISSIONS} as p`, 'p.id', 'rp.permission_id')
|
|
|
|
.where('rp.role_id', '=', roleId);
|
|
|
|
stopTimer();
|
|
|
|
return rows.map((permission) => {
|
|
|
|
return {
|
|
|
|
id: permission.id,
|
|
|
|
name: permission.permission,
|
|
|
|
environment: permission.environment,
|
|
|
|
displayName: permission.display_name,
|
|
|
|
type: permission.type,
|
|
|
|
};
|
|
|
|
});
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async addEnvironmentPermissionsToRole(
|
|
|
|
role_id: number,
|
|
|
|
permissions: IPermission[],
|
|
|
|
): Promise<void> {
|
|
|
|
const rows = permissions.map((permission) => {
|
|
|
|
return {
|
|
|
|
role_id,
|
|
|
|
permission_id: permission.id,
|
|
|
|
environment: permission.environment,
|
|
|
|
};
|
|
|
|
});
|
2022-04-01 11:10:21 +02:00
|
|
|
await this.db.batchInsert(T.ROLE_PERMISSION, rows);
|
2021-04-09 13:46:53 +02:00
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async unlinkUserRoles(userId: number): Promise<void> {
|
|
|
|
return this.db(T.ROLE_USER)
|
2021-03-11 22:51:58 +01:00
|
|
|
.where({
|
2022-01-13 11:14:17 +01:00
|
|
|
user_id: userId,
|
2021-03-11 22:51:58 +01:00
|
|
|
})
|
|
|
|
.delete();
|
|
|
|
}
|
|
|
|
|
2022-07-21 16:23:56 +02:00
|
|
|
async getProjectUsersForRole(
|
2022-01-13 11:14:17 +01:00
|
|
|
roleId: number,
|
|
|
|
projectId?: string,
|
2022-07-21 16:23:56 +02:00
|
|
|
): Promise<IUserRole[]> {
|
2022-01-13 11:14:17 +01:00
|
|
|
const rows = await this.db
|
2022-07-21 16:23:56 +02:00
|
|
|
.select(['user_id', 'ru.created_at'])
|
2022-01-13 11:14:17 +01:00
|
|
|
.from<IRole>(`${T.ROLE_USER} AS ru`)
|
|
|
|
.join(`${T.ROLES} as r`, 'ru.role_id', 'id')
|
|
|
|
.where('r.id', roleId)
|
|
|
|
.andWhere('ru.project', projectId);
|
2022-07-21 16:23:56 +02:00
|
|
|
return rows.map((r) => ({
|
|
|
|
userId: r.user_id,
|
|
|
|
addedAt: r.created_at,
|
|
|
|
}));
|
2022-01-13 11:14:17 +01:00
|
|
|
}
|
|
|
|
|
2022-09-30 13:36:45 +02:00
|
|
|
async getRolesForUserId(userId: number): Promise<IRoleWithProject[]> {
|
2021-03-11 22:51:58 +01:00
|
|
|
return this.db
|
|
|
|
.select(['id', 'name', 'type', 'project', 'description'])
|
|
|
|
.from<IRole[]>(T.ROLES)
|
|
|
|
.innerJoin(`${T.ROLE_USER} as ru`, 'ru.role_id', 'id')
|
|
|
|
.where('ru.user_id', '=', userId);
|
|
|
|
}
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
async getUserIdsForRole(roleId: number): Promise<number[]> {
|
2021-03-11 22:51:58 +01:00
|
|
|
const rows = await this.db
|
|
|
|
.select(['user_id'])
|
|
|
|
.from<IRole>(T.ROLE_USER)
|
|
|
|
.where('role_id', roleId);
|
2021-08-12 15:04:37 +02:00
|
|
|
return rows.map((r) => r.user_id);
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async addUserToRole(
|
|
|
|
userId: number,
|
|
|
|
roleId: number,
|
2022-07-21 16:23:56 +02:00
|
|
|
projectId?: string,
|
2022-01-13 11:14:17 +01:00
|
|
|
): Promise<void> {
|
2021-03-11 22:51:58 +01:00
|
|
|
return this.db(T.ROLE_USER).insert({
|
|
|
|
user_id: userId,
|
|
|
|
role_id: roleId,
|
2022-07-21 16:23:56 +02:00
|
|
|
project: projectId,
|
2021-03-11 22:51:58 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async removeUserFromRole(
|
|
|
|
userId: number,
|
|
|
|
roleId: number,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<void> {
|
2021-03-11 22:51:58 +01:00
|
|
|
return this.db(T.ROLE_USER)
|
|
|
|
.where({
|
|
|
|
user_id: userId,
|
|
|
|
role_id: roleId,
|
2022-01-13 11:14:17 +01:00
|
|
|
project: projectId,
|
2021-03-11 22:51:58 +01:00
|
|
|
})
|
|
|
|
.delete();
|
|
|
|
}
|
|
|
|
|
2022-07-21 16:23:56 +02:00
|
|
|
async addGroupToRole(
|
|
|
|
groupId: number,
|
|
|
|
roleId: number,
|
|
|
|
createdBy: string,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<void> {
|
|
|
|
return this.db(T.GROUP_ROLE).insert({
|
|
|
|
group_id: groupId,
|
|
|
|
role_id: roleId,
|
|
|
|
project: projectId,
|
|
|
|
created_by: createdBy,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async removeGroupFromRole(
|
|
|
|
groupId: number,
|
|
|
|
roleId: number,
|
|
|
|
projectId?: string,
|
|
|
|
): Promise<void> {
|
|
|
|
return this.db(T.GROUP_ROLE)
|
|
|
|
.where({
|
|
|
|
group_id: groupId,
|
|
|
|
role_id: roleId,
|
|
|
|
project: projectId,
|
|
|
|
})
|
|
|
|
.delete();
|
|
|
|
}
|
|
|
|
|
2022-02-21 14:39:59 +01:00
|
|
|
async updateUserProjectRole(
|
|
|
|
userId: number,
|
|
|
|
roleId: number,
|
|
|
|
projectId: string,
|
|
|
|
): Promise<void> {
|
|
|
|
return this.db(T.ROLE_USER)
|
|
|
|
.where({
|
|
|
|
user_id: userId,
|
|
|
|
project: projectId,
|
|
|
|
})
|
2022-05-26 16:20:36 +02:00
|
|
|
.whereNotIn(
|
|
|
|
'role_id',
|
|
|
|
this.db(T.ROLES).select('id as role_id').where('type', 'root'),
|
|
|
|
)
|
2022-02-21 14:39:59 +01:00
|
|
|
.update('role_id', roleId);
|
|
|
|
}
|
|
|
|
|
2022-07-21 16:23:56 +02:00
|
|
|
updateGroupProjectRole(
|
|
|
|
groupId: number,
|
|
|
|
roleId: number,
|
|
|
|
projectId: string,
|
|
|
|
): Promise<void> {
|
|
|
|
return this.db(T.GROUP_ROLE)
|
|
|
|
.where({
|
|
|
|
group_id: groupId,
|
|
|
|
project: projectId,
|
|
|
|
})
|
|
|
|
.whereNotIn(
|
|
|
|
'role_id',
|
|
|
|
this.db(T.ROLES).select('id as role_id').where('type', 'root'),
|
|
|
|
)
|
|
|
|
.update('role_id', roleId);
|
|
|
|
}
|
|
|
|
|
|
|
|
async addAccessToProject(
|
|
|
|
users: IAccessInfo[],
|
|
|
|
groups: IAccessInfo[],
|
|
|
|
projectId: string,
|
|
|
|
roleId: number,
|
|
|
|
createdBy: string,
|
|
|
|
): Promise<void> {
|
|
|
|
const userRows = users.map((user) => {
|
|
|
|
return {
|
|
|
|
user_id: user.id,
|
|
|
|
project: projectId,
|
|
|
|
role_id: roleId,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
const groupRows = groups.map((group) => {
|
|
|
|
return {
|
|
|
|
group_id: group.id,
|
|
|
|
project: projectId,
|
|
|
|
role_id: roleId,
|
|
|
|
created_by: createdBy,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
await this.db.transaction(async (tx) => {
|
|
|
|
if (userRows.length > 0) {
|
|
|
|
await tx(T.ROLE_USER)
|
|
|
|
.insert(userRows)
|
|
|
|
.onConflict(['project', 'role_id', 'user_id'])
|
|
|
|
.merge();
|
|
|
|
}
|
|
|
|
if (groupRows.length > 0) {
|
|
|
|
await tx(T.GROUP_ROLE)
|
|
|
|
.insert(groupRows)
|
|
|
|
.onConflict(['project', 'role_id', 'group_id'])
|
|
|
|
.merge();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-04-09 13:46:53 +02:00
|
|
|
async removeRolesOfTypeForUser(
|
|
|
|
userId: number,
|
|
|
|
roleType: string,
|
|
|
|
): Promise<void> {
|
|
|
|
const rolesToRemove = this.db(T.ROLES)
|
|
|
|
.select('id')
|
|
|
|
.where({ type: roleType });
|
|
|
|
|
|
|
|
return this.db(T.ROLE_USER)
|
|
|
|
.where({ user_id: userId })
|
|
|
|
.whereIn('role_id', rolesToRemove)
|
|
|
|
.delete();
|
|
|
|
}
|
|
|
|
|
2021-03-11 22:51:58 +01:00
|
|
|
async addPermissionsToRole(
|
|
|
|
role_id: number,
|
|
|
|
permissions: string[],
|
2022-01-13 11:14:17 +01:00
|
|
|
environment?: string,
|
2021-03-11 22:51:58 +01:00
|
|
|
): Promise<void> {
|
2022-01-13 11:14:17 +01:00
|
|
|
const rows = await this.db
|
|
|
|
.select('id as permissionId')
|
|
|
|
.from<number>(T.PERMISSIONS)
|
|
|
|
.whereIn('permission', permissions);
|
|
|
|
|
|
|
|
const newRoles = rows.map((row) => ({
|
2021-03-11 22:51:58 +01:00
|
|
|
role_id,
|
2022-01-13 11:14:17 +01:00
|
|
|
environment,
|
|
|
|
permission_id: row.permissionId,
|
2021-03-11 22:51:58 +01:00
|
|
|
}));
|
2022-01-13 11:14:17 +01:00
|
|
|
|
|
|
|
return this.db.batchInsert(T.ROLE_PERMISSION, newRoles);
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
async removePermissionFromRole(
|
2022-01-13 11:14:17 +01:00
|
|
|
role_id: number,
|
2021-03-11 22:51:58 +01:00
|
|
|
permission: string,
|
2022-01-13 11:14:17 +01:00
|
|
|
environment?: string,
|
2021-03-11 22:51:58 +01:00
|
|
|
): Promise<void> {
|
2022-01-13 11:14:17 +01:00
|
|
|
const rows = await this.db
|
|
|
|
.select('id as permissionId')
|
|
|
|
.from<number>(T.PERMISSIONS)
|
|
|
|
.where('permission', permission);
|
|
|
|
|
|
|
|
const permissionId = rows[0].permissionId;
|
|
|
|
|
2021-03-11 22:51:58 +01:00
|
|
|
return this.db(T.ROLE_PERMISSION)
|
|
|
|
.where({
|
2022-01-13 11:14:17 +01:00
|
|
|
role_id,
|
|
|
|
permission_id: permissionId,
|
|
|
|
environment,
|
2021-03-11 22:51:58 +01:00
|
|
|
})
|
|
|
|
.delete();
|
|
|
|
}
|
2021-04-09 13:46:53 +02:00
|
|
|
|
2022-01-13 11:14:17 +01:00
|
|
|
async wipePermissionsFromRole(role_id: number): Promise<void> {
|
|
|
|
return this.db(T.ROLE_PERMISSION)
|
|
|
|
.where({
|
|
|
|
role_id,
|
|
|
|
})
|
|
|
|
.delete();
|
2021-04-09 13:46:53 +02:00
|
|
|
}
|
2022-10-28 11:27:11 +02:00
|
|
|
|
|
|
|
async cloneEnvironmentPermissions(
|
|
|
|
sourceEnvironment: string,
|
|
|
|
destinationEnvironment: string,
|
|
|
|
): Promise<void> {
|
|
|
|
return this.db.raw(
|
|
|
|
`insert into role_permission
|
|
|
|
(role_id, permission_id, environment)
|
|
|
|
(select role_id, permission_id, ?
|
|
|
|
from ${T.ROLE_PERMISSION} where environment = ?)`,
|
|
|
|
[destinationEnvironment, sourceEnvironment],
|
|
|
|
);
|
|
|
|
}
|
2022-11-14 14:05:26 +01:00
|
|
|
|
|
|
|
async isChangeRequestsEnabled(
|
|
|
|
project: string,
|
|
|
|
environment: string,
|
|
|
|
): Promise<boolean> {
|
|
|
|
const result = await this.db.raw(
|
|
|
|
`SELECT EXISTS(SELECT 1 FROM ${T.CHANGE_REQUEST_SETTINGS}
|
|
|
|
WHERE environment = ? and project = ?) AS present`,
|
|
|
|
[environment, project],
|
|
|
|
);
|
|
|
|
const { present } = result.rows[0];
|
|
|
|
return present;
|
|
|
|
}
|
2021-03-11 22:51:58 +01:00
|
|
|
}
|