@@ -46,8 +46,9 @@ import { Link, Navigate, Outlet, useParams } from "react-router";
|
|||||||
import { graphql } from "relay-runtime";
|
import { graphql } from "relay-runtime";
|
||||||
import type { MainLayoutQuery as MainLayoutQueryType } from "./__generated__/MainLayoutQuery.graphql";
|
import type { MainLayoutQuery as MainLayoutQueryType } from "./__generated__/MainLayoutQuery.graphql";
|
||||||
import { PageError } from "/components/PageError";
|
import { PageError } from "/components/PageError";
|
||||||
import { PermissionsContext, PermissionsProvider } from "/providers/PermissionsProvider";
|
import { PermissionsProvider } from "/providers/PermissionsProvider";
|
||||||
import { buildEndpoint } from "/providers/RelayProviders";
|
import { buildEndpoint } from "/providers/RelayProviders";
|
||||||
|
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||||
|
|
||||||
const MainLayoutQuery = graphql`
|
const MainLayoutQuery = graphql`
|
||||||
query MainLayoutQuery($organizationId: ID!) {
|
query MainLayoutQuery($organizationId: ID!) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import {
|
|||||||
type BulkExportDialogRef,
|
type BulkExportDialogRef,
|
||||||
} from "/components/documents/BulkExportDialog";
|
} from "/components/documents/BulkExportDialog";
|
||||||
import type { DocumentsPageUserEmailQuery } from "./__generated__/DocumentsPageUserEmailQuery.graphql";
|
import type { DocumentsPageUserEmailQuery } from "./__generated__/DocumentsPageUserEmailQuery.graphql";
|
||||||
import { PermissionsContext } from "/providers/PermissionsProvider.tsx";
|
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||||
|
|
||||||
const documentsFragment = graphql`
|
const documentsFragment = graphql`
|
||||||
fragment DocumentsPageListFragment on Organization
|
fragment DocumentsPageListFragment on Organization
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ export default function ProcessingActivityDetailsPage(props: Props) {
|
|||||||
|
|
||||||
{!isSnapshotMode && (
|
{!isSnapshotMode && (
|
||||||
<div className="flex justify-end pt-4">
|
<div className="flex justify-end pt-4">
|
||||||
<Authorized entity="ProcessingActivity" action="updateProcessingActivity">
|
{isAuthorized("ProcessingActivity", "updateProcessingActivity") && (
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant="primary"
|
variant="primary"
|
||||||
@@ -420,7 +420,7 @@ export default function ProcessingActivityDetailsPage(props: Props) {
|
|||||||
>
|
>
|
||||||
{formState.isSubmitting ? __("Saving...") : __("Save Changes")}
|
{formState.isSubmitting ? __("Saving...") : __("Save Changes")}
|
||||||
</Button>
|
</Button>
|
||||||
</Authorized>
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -423,14 +423,14 @@ export default function TrustCenterAccessTab() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{organization.trustCenter?.id && (
|
{organization.trustCenter?.id && (
|
||||||
{isAuthorized("TrustCenter", "createTrustCenterAccess") && (
|
isAuthorized("TrustCenter", "createTrustCenterAccess") && (
|
||||||
<Button icon={IconPlusLarge} onClick={() => {
|
<Button icon={IconPlusLarge} onClick={() => {
|
||||||
inviteForm.reset();
|
inviteForm.reset();
|
||||||
dialogRef.current?.open();
|
dialogRef.current?.open();
|
||||||
}}>
|
}}>
|
||||||
{__("Add Access")}
|
{__("Add Access")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
export enum Role {
|
export const Role = {
|
||||||
OWNER = "OWNER",
|
OWNER: "OWNER",
|
||||||
ADMIN = "ADMIN",
|
ADMIN: "ADMIN",
|
||||||
VIEWER = "VIEWER",
|
VIEWER: "VIEWER",
|
||||||
}
|
} as const
|
||||||
|
|
||||||
export function getAssignableRoles(currentRole: Role): string[] {
|
export type Role = (typeof Role)[keyof typeof Role];
|
||||||
if (!currentRole) return [];
|
|
||||||
|
|
||||||
if (currentRole === "OWNER") {
|
export function getAssignableRoles(currentRole: Role): Role[] {
|
||||||
return ["OWNER", "ADMIN", "VIEWER"];
|
if (currentRole === Role.OWNER) {
|
||||||
|
return [Role.OWNER, Role.ADMIN, Role.VIEWER];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentRole === "ADMIN") {
|
if (currentRole === Role.ADMIN) {
|
||||||
return ["ADMIN", "VIEWER"];
|
return [Role.ADMIN, Role.VIEWER];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
Reference in New Issue
Block a user