Add more ACL checkers to help with port forward and one to one NAT for multi user.

This commit is contained in:
Scott Ullrich 2007-12-03 04:48:12 +00:00
parent 99ea44397a
commit 0397013a40

View File

@ -33,6 +33,44 @@
*
*/
/****f* pfsense-utils/have_natonetooneruleint_access
* NAME
* have_natonetooneruleint_access
* INPUTS
* none
* RESULT
* returns true if user has access to edit a specific firewall nat one to one interface
******/
function have_natonetooneruleint_access($if) {
global $config, $g, $HTTP_SERVER_VARS;
$allowed = $g['privs'];
if (isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))
return true;
$security_url = "firewall_nat_1to1_edit.php?if=". strtolower($if);
if(in_array($security_url, $allowed))
return true;
return false;
}
/****f* pfsense-utils/have_natpfruleint_access
* NAME
* have_natpfruleint_access
* INPUTS
* none
* RESULT
* returns true if user has access to edit a specific firewall nat port forward interface
******/
function have_natpfruleint_access($if) {
global $config, $g, $HTTP_SERVER_VARS;
$allowed = $g['privs'];
if (isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))
return true;
$security_url = "firewall_nat_edit.php?if=". strtolower($if);
if(in_array($security_url, $allowed))
return true;
return false;
}
/****f* pfsense-utils/have_ruleint_access
* NAME
* have_ruleint_access