Changeset View
Changeset View
Standalone View
Standalone View
core/units/helpers/permissions_helper.php
Show First 20 Lines • Show All 578 Lines • ▼ Show 20 Line(s) | |||||
$user_id = $this->Application->RecallVar('admin_user_id'); | $user_id = $this->Application->RecallVar('admin_user_id'); | ||||
return $this->CheckUserPermission($user_id, $name, $type, $cat_id); | return $this->CheckUserPermission($user_id, $name, $type, $cat_id); | ||||
} | } | ||||
function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null) | function CheckUserPermission($user_id, $name, $type = 1, $cat_id = null) | ||||
{ | { | ||||
$user_id = (int)$user_id; | $user_id = (int)$user_id; | ||||
if ( $user_id == USER_ROOT ) { | if ( $this->Application->permissionCheckingDisabled($user_id) ) { | ||||
// "root" is allowed anywhere | |||||
return substr($name, -5) == '.deny' || $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1; | return substr($name, -5) == '.deny' || $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1; | ||||
} | } | ||||
if ( !isset($cat_id) ) { | if ( !isset($cat_id) ) { | ||||
$cat_id = $this->Application->GetVar('m_cat_id'); | $cat_id = $this->Application->GetVar('m_cat_id'); | ||||
} | } | ||||
if ( $type == 1 ) { | if ( $type == 1 ) { | ||||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Line(s) | |||||
return 1; | return 1; | ||||
} | } | ||||
else if ($this->CheckPermission($perm_prefix.'.ADD.PENDING', ptCATEGORY, $category_id)) { | else if ($this->CheckPermission($perm_prefix.'.ADD.PENDING', ptCATEGORY, $category_id)) { | ||||
return 2; | return 2; | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
Lint: CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace: Expected 0 spaces before closing brace; 4 found | |||||
No newline at end of file |
Expected 0 spaces before closing brace; 4 found