mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { PermissionHelper, PermissionProps } from 'Common/Types/Permission';
|
|
import { ExpressRequest, ExpressResponse } from 'CommonServer/Utils/Express';
|
|
import ResourceUtil, { ModelDocumentation } from '../Utils/Resources';
|
|
|
|
const Resources: Array<ModelDocumentation> = ResourceUtil.getResources();
|
|
|
|
export default class ServiceHandler {
|
|
public static async executeResponse(
|
|
req: ExpressRequest,
|
|
res: ExpressResponse
|
|
): Promise<void> {
|
|
let pageTitle: string = '';
|
|
let pageDescription: string = '';
|
|
const page: string | undefined = req.params['page'];
|
|
const pageData: any = {};
|
|
|
|
pageTitle = 'Permissions';
|
|
pageDescription = 'Learn how permisisons work with OneUptime';
|
|
|
|
pageData.permissions = PermissionHelper.getAllPermissionProps().filter(
|
|
(i: PermissionProps) => {
|
|
return i.isAssignableToTenant;
|
|
}
|
|
);
|
|
|
|
return res.render('pages/index', {
|
|
page: page,
|
|
resources: Resources,
|
|
pageTitle: pageTitle,
|
|
pageDescription: pageDescription,
|
|
pageData: pageData,
|
|
});
|
|
}
|
|
}
|