fix: change permissions object shape

This commit is contained in:
Philipinho
2026-06-15 17:51:12 +01:00
parent ab1b3723bc
commit a45dd8919d
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export default function BasePage() {
{base.icon ? `${base.icon} ` : ""}{base.name}
</Title>
)}
<BaseView pageId={pageId} editable={hasBases && (base?.canEdit ?? false)} />
<BaseView pageId={pageId} editable={hasBases && (base?.permissions?.canEdit ?? false)} />
</Container>
);
}
+4 -2
View File
@@ -246,8 +246,10 @@ export type IBase = {
views: IBaseView[];
createdAt: string;
updatedAt: string;
/** Effective edit permission for the current user (page-restrictions included). */
canEdit?: boolean;
permissions?: {
canEdit: boolean;
hasRestriction: boolean;
};
baseSchemaVersion: number;
};
@@ -132,7 +132,7 @@ export function BaseEmbedView({ node, editor, deleteNode }: NodeViewProps) {
<BaseView
pageId={pageId}
embedded
editable={hasBases && editor.isEditable && (base?.canEdit ?? false)}
editable={hasBases && editor.isEditable && (base?.permissions?.canEdit ?? false)}
/>
);
}