Allow each database to determine if a user is allowed to perform CRUD operations on tables

This commit is contained in:
Oliver-Akins 2025-05-29 23:42:14 -06:00
parent 2b782fd5ed
commit a13310aaad
2 changed files with 38 additions and 4 deletions

View file

@ -44,8 +44,10 @@ export class StatSidebar extends HandlebarsApplicationMixin(AbstractSidebarTab)
// manageData: { label: `Manage Data`, action: `` },
};
if (!game.user.isGM) {
if (!db.canCreateTables()) {
delete controls.createTable;
};
if (!db.canEditTables()) {
delete controls.manageTables;
};
@ -55,7 +57,6 @@ export class StatSidebar extends HandlebarsApplicationMixin(AbstractSidebarTab)
// delete controls.manageData;
// };
Hooks.callAll(`${__ID__}.getStatsSidebarControls`, controls);
ctx.controls = Object.values(controls);
return ctx;