diff --git a/admin/includes/inc_all_admin.php b/admin/includes/inc_all_admin.php
index 8c051fba..9953cd6b 100644
--- a/admin/includes/inc_all_admin.php
+++ b/admin/includes/inc_all_admin.php
@@ -4,9 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/check_login.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/page_title.php';
-if (!isset($session_is_admin) || !$session_is_admin) {
- exit(WORDING_ROLECHECK_FAILED . "
Tell your admin: Your role does not have admin access.");
-}
+enforceAdminPermission();
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/top_nav.php';
require_once 'includes/side_nav.php';
diff --git a/admin/post/update.php b/admin/post/update.php
index 37ef8021..6099a858 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -4,7 +4,7 @@ defined('FROM_POST_HANDLER') || die("Direct file access is not allowed");
if (isset($_GET['update'])) {
- validateAdminRole(); // Old function
+ enforceAdminPermission();
//git fetch downloads the latest from remote without trying to merge or rebase anything. Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master
diff --git a/agent/custom/index.php b/agent/custom/index.php
index 558c87ae..d97afaa0 100644
--- a/agent/custom/index.php
+++ b/agent/custom/index.php
@@ -13,7 +13,6 @@
This is a great starting point for new custom pages.
- Tell your admin: Your role does not have admin access."); + } + return true; +} + // Ensures a user has access to a module (e.g. module_support) with at least the required permission level provided (defaults to read) function enforceUserPermission($module, $check_access_level = 1) { $permitted_access_level = lookupUserPermission($module);