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