summaryrefslogtreecommitdiffstats
path: root/modules-available/runmode/inc/runmode.inc.php
diff options
context:
space:
mode:
authorroot2019-02-19 18:53:50 +0100
committerroot2019-02-19 18:53:50 +0100
commit0ad4c0f8196b61699754762aacbaab0223478ab9 (patch)
treede434c4aea8d07ecd01cd3badd48d057d62c2d1b /modules-available/runmode/inc/runmode.inc.php
parent[usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff)
parent[statistics] Fix RAM change warning to handle increase too (diff)
downloadslx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.gz
slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.xz
slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.zip
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'modules-available/runmode/inc/runmode.inc.php')
-rw-r--r--modules-available/runmode/inc/runmode.inc.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules-available/runmode/inc/runmode.inc.php b/modules-available/runmode/inc/runmode.inc.php
index 2c8083ca..174fb675 100644
--- a/modules-available/runmode/inc/runmode.inc.php
+++ b/modules-available/runmode/inc/runmode.inc.php
@@ -28,7 +28,7 @@ class RunMode
/**
* @param string $machineuuid
- * @param string $moduleId
+ * @param string|\Module $moduleId
* @param string|null $modeId an ID specific to the module to further specify the run mode, NULL to delete the run mode entry
* @param string|null $modeData optional, additional data for the run mode
* @param bool|null $isClient whether to count the machine as a client (in statistics etc.) NULL for looking at module's general runmode config
@@ -284,6 +284,11 @@ class RunModeModuleConfig
*/
public $deleteUrlSnippet = false;
+ /**
+ * @var string|false Permission to check when accessing/assigning
+ */
+ public $permission = false;
+
public function __construct($file)
{
$data = json_decode(file_get_contents($file), true);
@@ -298,6 +303,7 @@ class RunModeModuleConfig
$this->loadType($data, 'noSysconfig', 'boolean');
$this->loadType($data, 'allowGenericEditor', 'boolean');
$this->loadType($data, 'deleteUrlSnippet', 'string');
+ $this->loadType($data, 'permission', 'string');
}
private function loadType($data, $key, $type)
@@ -311,4 +317,10 @@ class RunModeModuleConfig
$this->{$key} = $data[$key];
return true;
}
+
+ public function userHasPermission($locationId)
+ {
+ return $this->permission === false || User::hasPermission($this->permission, $locationId);
+ }
+
}