Remove unused permission checks
This commit is contained in:
parent
c50aa6a8d0
commit
9685a22aa1
@ -715,38 +715,12 @@ function hesk_okCategory($cat,$error=1,$user_isadmin=false,$user_cat=false)
|
||||
function hesk_checkPermission($feature,$showerror=1) {
|
||||
global $hesklang;
|
||||
|
||||
/* Check if this is for managing settings */
|
||||
if ($feature == 'can_manage_settings')
|
||||
{
|
||||
if ($_SESSION['can_manage_settings']) {
|
||||
return true;
|
||||
} else {
|
||||
if ($showerror) {
|
||||
hesk_error($hesklang['no_permission'].'<p> </p><p align="center"><a href="index.php">'.$hesklang['click_login'].'</a>');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Admins have full access to all features */
|
||||
if ($_SESSION['isadmin'])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($feature == 'can_manage_email_templates') {
|
||||
if ($_SESSION['can_manage_email_templates']) {
|
||||
return true;
|
||||
} else {
|
||||
if ($showerror) {
|
||||
hesk_error($hesklang['no_permission'].'<p> </p><p align="center"><a href="index.php">'.$hesklang['click_login'].'</a>');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check other staff for permissions */
|
||||
if (strpos($_SESSION['heskprivileges'], $feature) === false)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user