fixed employees permission
This commit is contained in:
@@ -6,10 +6,11 @@ $pdo = DBHandlerSelect::getInstance()->getConnection();
|
||||
/* ==========================================
|
||||
PERMISSIONS
|
||||
========================================== */
|
||||
$isHrManager = Auth::user()->hasRole('Admin')
|
||||
|| Auth::user()->hasRole('Superuser')
|
||||
|| Auth::user()->hasRole('employee-hr')
|
||||
|| Auth::user()->hasRole('manager');
|
||||
$canEdit = userCan('hr.employee_profiles.edit');
|
||||
$canViewOthers = $canEdit || userCan('hr.employee_profiles.view');
|
||||
|
||||
// Compatibilità con il resto della pagina (pulsante "Torna ai Dipendenti" ecc.)
|
||||
$isHrManager = $canViewOthers;
|
||||
|
||||
/* ==========================================
|
||||
RESOLVE TARGET EMPLOYEE
|
||||
@@ -67,7 +68,7 @@ if (!$isHrManager && $employee && (int)$employee['auth_user_id'] !== (int)$iduse
|
||||
exit;
|
||||
}
|
||||
|
||||
$canEdit = $isHrManager;
|
||||
|
||||
|
||||
/* ==========================================
|
||||
EMPLOYEE JOB ROLES / SUB ROLES (multi assignment)
|
||||
|
||||
Reference in New Issue
Block a user