diff --git a/public/tramites/api.php b/public/tramites/api.php index aa7be47..ee95b1b 100644 --- a/public/tramites/api.php +++ b/public/tramites/api.php @@ -369,9 +369,8 @@ try { $tramiteId = (int)$row['tramite_id']; if (!canView($pdo, $tramiteId)) err('No tienes acceso al trámite', 403); - if (!Auth::isSocio() && $row['autor_email'] !== $user['email']) { - err('Solo quien registró las horas (o un Socio/Admin) puede editarlas', 403); - } + // Cualquiera que pueda ver el trámite (creador, abogado solicitante, + // involucrado, o socio/admin) puede editar las horas registradas. $abog = trim((string)($b['abogado'] ?? $row['abogado'])); $hrs = (float) ($b['hrs'] ?? $row['hrs']); @@ -400,9 +399,7 @@ try { $tramiteId = (int)$row['tramite_id']; if (!canView($pdo, $tramiteId)) err('No tienes acceso al trámite', 403); - if (!Auth::isSocio() && $row['autor_email'] !== $user['email']) { - err('Solo quien registró las horas (o un Socio/Admin) puede eliminarlas', 403); - } + // Misma regla que update_hours: cualquiera con acceso al trámite puede eliminar. $pdo->prepare('DELETE FROM tramites_hours WHERE id = :id')->execute([':id' => $hourId]); $pdo->prepare('UPDATE tramites_legales SET actualizado_por = :u WHERE id = :id') diff --git a/views/tramites.html b/views/tramites.html index e974449..c271306 100644 --- a/views/tramites.html +++ b/views/tramites.html @@ -538,14 +538,13 @@ function buildDetail(dept,r){ const obs=(r.obs||[]).map(o=>`