ad hoc permissions (TODO improve)

This commit is contained in:
Jan Prochazka 2022-03-17 19:46:09 +01:00
parent d888feeaf8
commit bf1a89ee21
4 changed files with 11 additions and 1 deletions

View File

@ -1 +1,3 @@
DEVMODE=1
# DISABLE_SHELL=1
# HIDE_APP_EDITOR=1

View File

@ -32,6 +32,7 @@ module.exports = {
return {
runAsPortal: !!connections.portalConnections,
singleDatabase: connections.singleDatabase,
hideAppEditor: !!process.env.HIDE_APP_EDITOR,
permissions,
...currentVersion,
};

View File

@ -149,6 +149,10 @@ module.exports = {
start_meta: true,
async start({ script }) {
if (process.env.DISABLE_SHELL) {
return { errorMessage: 'Shell is disabled' };
}
const runid = uuidv1();
return this.startCore(runid, scriptTemplate(script, false));
},

View File

@ -3,6 +3,7 @@
import FontIcon from '../icons/FontIcon.svelte';
import { currentDropDownMenu, selectedWidget, visibleCommandPalette, visibleHamburgerMenuWidget } from '../stores';
import mainMenuDefinition from '../../../../app/src/mainMenuDefinition';
import { useConfig } from '../utility/metadataLoaders';
let domSettings;
let domMainMenu;
@ -77,6 +78,8 @@
const items = mainMenuDefinition;
currentDropDownMenu.set({ left, top, items });
}
$: config = useConfig();
</script>
<div class="main">
@ -85,7 +88,7 @@
<FontIcon icon="icon menu" />
</div>
{/if}
{#each widgets as item}
{#each widgets.filter(x => !$config?.hideAppEditor || x.name != 'app') as item}
<div class="wrapper" class:selected={item.name == $selectedWidget} on:click={() => handleChangeWidget(item.name)}>
<FontIcon icon={item.icon} title={item.title} />
</div>