diff options
author | Simon Rettberg | 2014-10-06 19:30:38 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-10-06 19:30:38 +0200 |
commit | 9792e13f6ef1c9855ebe0736e7a1effc535dac76 (patch) | |
tree | 07516ae42f0508c395f91607d94db7dcf92e4f06 /inc/permission.inc.php | |
parent | Use eventlog in init and update API, populate database with default values on... (diff) | |
download | slx-admin-9792e13f6ef1c9855ebe0736e7a1effc535dac76.tar.gz slx-admin-9792e13f6ef1c9855ebe0736e7a1effc535dac76.tar.xz slx-admin-9792e13f6ef1c9855ebe0736e7a1effc535dac76.zip |
Minor fixes and improvements
Diffstat (limited to 'inc/permission.inc.php')
-rw-r--r-- | inc/permission.inc.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/inc/permission.inc.php b/inc/permission.inc.php index b63e9d45..f90319a4 100644 --- a/inc/permission.inc.php +++ b/inc/permission.inc.php @@ -2,24 +2,17 @@ class Permission { - private static $permissions = false; + private static $permissions = array( + 'superadmin' => 1, + 'baseconfig_global' => 2, + 'baseconfig_local' => 4, + ); public static function get($permission) { - self::init(); if (!isset(self::$permissions[$permission])) Util::traceError('Invalid permission: ' . $permission); return self::$permissions[$permission]; } - private static function init() - { - if (self::$permissions !== false) return; - self::$permissions = array(); - $res = Database::simpleQuery('SELECT mask, identifier FROM permission'); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - self::$permissions[$row['identifier']] = $row['mask']; - } - } - } |