Refactor CRUD permissions to include read access

This commit is contained in:
Simon Larsen 2024-10-23 12:50:02 +01:00
parent 986479e8d5
commit 05a2fe6665
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA
75 changed files with 77 additions and 3 deletions

View File

@ -75,6 +75,7 @@ import { TelemetryQuery } from "../../Types/Telemetry/TelemetryQuery";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "Alert",

View File

@ -52,6 +52,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-internal-note"))
@Entity({

View File

@ -62,6 +62,7 @@ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "AlertNoteTemplate",

View File

@ -51,6 +51,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-owner-team"))
@TableMetadata({

View File

@ -50,6 +50,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-owner-user"))
@TableMetadata({

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-severity"))
@SlugifyColumn("name", "slug")

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-state"))
@SlugifyColumn("name", "slug")

View File

@ -54,6 +54,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/alert-state-timeline"))
@Entity({

View File

@ -67,6 +67,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@TenantColumn("projectId")
@CrudApiEndpoint(new Route("/api-key-permission"))

View File

@ -73,6 +73,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/copilot-code-repository"))
@SlugifyColumn("name", "slug")

View File

@ -61,6 +61,7 @@ import DashboardViewConfig from "../../Types/Dashboard/DashboardViewConfig";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/dashboard"))
@SlugifyColumn("name", "slug")

View File

@ -77,6 +77,7 @@ import { TelemetryQuery } from "../../Types/Telemetry/TelemetryQuery";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "Incident",

View File

@ -52,6 +52,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-internal-note"))
@Entity({

View File

@ -62,6 +62,7 @@ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "IncidentNoteTemplate",

View File

@ -51,6 +51,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-owner-team"))
@TableMetadata({

View File

@ -50,6 +50,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-owner-user"))
@TableMetadata({

View File

@ -52,6 +52,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-public-note"))
@Entity({

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-severity"))
@SlugifyColumn("name", "slug")

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-state"))
@SlugifyColumn("name", "slug")

View File

@ -54,6 +54,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-state-timeline"))
@Entity({

View File

@ -81,6 +81,7 @@ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "IncidentTemplate",

View File

@ -51,6 +51,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-template-owner-team"))
@TableMetadata({

View File

@ -51,6 +51,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/incident-template-owner-user"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/label"))
@SlugifyColumn("name", "slug")

View File

@ -68,6 +68,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor"))
@SlugifyColumn("name", "slug")

View File

@ -70,6 +70,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-group"))
@SlugifyColumn("name", "slug")

View File

@ -59,6 +59,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-group-owner-team"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-group-owner-user"))
@TableMetadata({

View File

@ -53,6 +53,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-group-resource"))
@TableMetadata({

View File

@ -59,6 +59,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-owner-team"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-owner-user"))
@TableMetadata({

View File

@ -52,6 +52,7 @@ export type MonitorStepProbeResponse = Dictionary<ProbeMonitorResponse>;
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-probe"))
@TableMetadata({

View File

@ -65,6 +65,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-secret"))
@TableMetadata({

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-status"))
@SlugifyColumn("name", "slug")

View File

@ -55,6 +55,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/monitor-status-timeline"))
@SlugifyColumn("name", "slug")

View File

@ -59,6 +59,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/probe-owner-team"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/probe-owner-user"))
@TableMetadata({

View File

@ -75,6 +75,7 @@ import Recurring from "../../Types/Events/Recurring";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
singularName: "Scheduled Maintenance Event",

View File

@ -50,6 +50,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-internal-note"))
@Entity({

View File

@ -54,6 +54,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "ScheduledMaintenanceNoteTemplate",

View File

@ -51,6 +51,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-owner-team"))
@TableMetadata({

View File

@ -50,6 +50,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-owner-user"))
@TableMetadata({

View File

@ -52,6 +52,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-public-note"))
@Entity({

View File

@ -61,6 +61,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-state"))
@SlugifyColumn("name", "slug")

View File

@ -53,6 +53,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-state-timeline"))
@Entity({

View File

@ -83,6 +83,7 @@ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
singularName: "Scheduled Maintenance Template",

View File

@ -51,6 +51,7 @@ import ScheduledMaintenanceTemplate from "./ScheduledMaintenanceTemplate";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-template-owner-team"))
@TableMetadata({

View File

@ -50,6 +50,7 @@ import ScheduledMaintenanceTemplate from "./ScheduledMaintenanceTemplate";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/scheduled-maintenance-template--owner-user"))
@TableMetadata({

View File

@ -74,6 +74,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog"))
@SlugifyColumn("name", "slug")

View File

@ -62,6 +62,7 @@ import ServiceCatalog from "./ServiceCatalog";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog-dependency"))
@SlugifyColumn("name", "slug")

View File

@ -63,6 +63,7 @@ import Monitor from "./Monitor";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog-monitor"))
@SlugifyColumn("name", "slug")

View File

@ -59,6 +59,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog-owner-team"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog-owner-user"))
@TableMetadata({

View File

@ -63,6 +63,7 @@ import TelemetryService from "./TelemetryService";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-catalog-telemetry-service"))
@SlugifyColumn("name", "slug")

View File

@ -63,6 +63,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/service-copilot-code-repository"))
@TableMetadata({

View File

@ -74,6 +74,7 @@ import UptimePrecision from "../../Types/StatusPage/UptimePrecision";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page"))
@SlugifyColumn("name", "slug")

View File

@ -70,6 +70,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-announcement"))
@SlugifyColumn("name", "slug")

View File

@ -55,6 +55,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-domain"))
@TableMetadata({

View File

@ -55,6 +55,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-footer-link"))
@TableMetadata({

View File

@ -64,6 +64,7 @@ import UptimePrecision from "../../Types/StatusPage/UptimePrecision";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-group"))
@SlugifyColumn("name", "slug")

View File

@ -55,6 +55,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-header-link"))
@TableMetadata({

View File

@ -55,6 +55,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-history-chart-bar-color-rule"))
@TableMetadata({

View File

@ -59,6 +59,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-owner-team"))
@TableMetadata({

View File

@ -58,6 +58,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-owner-user"))
@TableMetadata({

View File

@ -64,6 +64,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-private-user"))
@SlugifyColumn("name", "slug")

View File

@ -58,6 +58,7 @@ import UptimePrecision from "../../Types/StatusPage/UptimePrecision";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/status-page-resource"))
@SlugifyColumn("name", "slug")

View File

@ -38,6 +38,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CanAccessIfCanReadOn("statusPage")
@TenantColumn("projectId")

View File

@ -58,6 +58,7 @@ import AnalyticsBaseModel from "../AnalyticsModels/AnalyticsBaseModel/AnalyticsB
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/table-view"))
@TableMetadata({

View File

@ -64,6 +64,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "Team",

View File

@ -63,6 +63,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "TeamMember",

View File

@ -73,6 +73,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@TableMetadata({
tableName: "TeamPermission",

View File

@ -49,6 +49,7 @@ import TelemetryService from "./TelemetryService";
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/telemetry-exception-status"))
@TableMetadata({

View File

@ -65,6 +65,7 @@ import {
create: true,
delete: true,
update: true,
read: true,
})
@CrudApiEndpoint(new Route("/telemetry-service"))
@SlugifyColumn("name", "slug")

View File

@ -2,4 +2,5 @@ export default interface EnableWorkflowOn {
create?: boolean | undefined;
update?: boolean | undefined;
delete?: boolean | undefined;
read?: boolean | undefined;
}

View File

@ -120,10 +120,10 @@ const DashboardNavbar: FunctionComponent<ComponentProps> = (
<NavBarItem
title="Dashboards"
activeRoute={RouteMap[PageMap.STATUS_PAGES]}
icon={IconProp.CheckCircle}
activeRoute={RouteMap[PageMap.DASHBOARDS]}
icon={IconProp.Window}
route={RouteUtil.populateRouteParams(
RouteMap[PageMap.STATUS_PAGES] as Route,
RouteMap[PageMap.DASHBOARDS] as Route,
)}
></NavBarItem>