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