Hide buttons for Fabric or when no write access (#1742)

This commit is contained in:
Laurent Nguyen
2024-02-09 14:10:57 +00:00
committed by GitHub
parent f8cfc6c21c
commit f403b086ad
4 changed files with 9 additions and 2 deletions

View File

@@ -881,6 +881,11 @@ export default class DocumentsTab extends TabsBase {
}
protected getTabsButtons(): CommandButtonComponentProps[] {
if (!userContext.hasWriteAccess) {
// All the following buttons require write access
return [];
}
const buttons: CommandButtonComponentProps[] = [];
const label = !this.isPreferredApiMongoDB ? "New Item" : "New Document";
if (this.newDocumentButton.visible()) {