permissins (per instance)

This commit is contained in:
Jan Prochazka
2020-12-10 11:54:28 +01:00
parent 698756b9d2
commit f993e82b0b
15 changed files with 114 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ const fs = require('fs-extra');
const path = require('path');
const cron = require('node-cron');
const runners = require('./runners');
const hasPermission = require('../utility/hasPermission');
const scheduleRegex = /\s*\/\/\s*@schedule\s+([^\n]+)\n/;
@@ -26,6 +27,7 @@ module.exports = {
},
async reload() {
if (!hasPermission('files/shell/read')) return;
const shellDir = path.join(filesdir(), 'shell');
await this.unload();
if (!(await fs.exists(shellDir))) return;