feat(followup-audio): separate uploader-only recording delete permission

This commit is contained in:
2026-10-12 16:36:47 +08:00
parent 11306e6314
commit bcd42a5c39
10 changed files with 263 additions and 13 deletions
@@ -74,6 +74,19 @@ final class FollowupAudioAccess
return $task;
}
/** One fresh authorization rule for both delete capability and the locked delete transaction. */
public static function deleteReason(array $task, int $actor): string
{
$info = self::actor($actor);
if (!self::allowed($actor, $info, 'tcm.followupAudio/delete')) {
return '缺少删除回访录音权限';
}
if ((int) $info['root'] !== 1 && (int) ($task['actor_id'] ?? 0) !== $actor) {
return '仅上传者或超级管理员可删除录音';
}
return '';
}
public static function canDaily(int $actor, array $info): bool
{
$info = self::actor($actor);