summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-03 02:15:19 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-03 02:15:19 +0000
commitb67429270b6619e88242bc82bd424332f453c684 (patch)
treead50cc0ce373196f8e21be8cd56428a189ba5e50 /etc
parentd81c2ad144ad3665df8c7986f3919133f447456c (diff)
downloadpfsense-b67429270b6619e88242bc82bd424332f453c684.zip
pfsense-b67429270b6619e88242bc82bd424332f453c684.tar.gz
Only show interfaces that the user has access to edit on the firewall rules edit page.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 7a684e6..8dbd305 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -33,6 +33,25 @@
*
*/
+/****f* pfsense-utils/have_ruleint_access
+ * NAME
+ * have_ruleint_access
+ * INPUTS
+ * none
+ * RESULT
+ * returns true if user has access to edit a specific firewall interface
+ ******/
+function have_ruleint_access($if) {
+ global $config, $g, $HTTP_SERVER_VARS;
+ $allowed = $g['privs'];
+ if (isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))
+ return true;
+ $security_url = "firewall_rules.php?if=". strtolower($if);
+ if(in_array($security_url, $allowed))
+ return true;
+ return false;
+}
+
/****f* pfsense-utils/does_url_exist
* NAME
* does_url_exist
OpenPOWER on IntegriCloud