feat(followup-audio): separate uploader-only recording delete permission
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user