Upload via GUI (452 Dateien)
This commit is contained in:
@@ -63,8 +63,8 @@ if (!in_array($newStatus, AVAILABILITY_STATUSES, true)) {
|
||||
// Ein Admin darf den Status eines anderen Mitarbeiters setzen (staffId), alle anderen nur den eigenen
|
||||
$targetId = (int) $staff['id'];
|
||||
if (isset($body['staffId']) && (int) $body['staffId'] !== $targetId) {
|
||||
if (($staff['role'] ?? '') !== 'admin') {
|
||||
api_error(403, 'FORBIDDEN', 'Nur Administratoren dürfen den Status anderer Mitarbeiter ändern.');
|
||||
if (!has_permission($staff, 'manage_availability')) {
|
||||
api_error(403, 'FORBIDDEN', 'Für den Status anderer Mitarbeiter fehlt die erforderliche Berechtigung.');
|
||||
}
|
||||
$targetId = (int) $body['staffId'];
|
||||
$exists = $pdo->prepare('SELECT COUNT(*) FROM staff WHERE id = ? AND is_active = 1');
|
||||
|
||||
Reference in New Issue
Block a user