mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add more ACL checkers to help with port forward and one to one NAT for multi user.
This commit is contained in:
parent
99ea44397a
commit
0397013a40
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user