wip
This commit is contained in:
parent
ebda878e1f
commit
a4cf3015dd
@ -13,7 +13,7 @@ enum Permission: string
|
||||
case StudyDownload = 'study_download';
|
||||
case StudyDelete = 'study_delete';
|
||||
case StudyArchive = 'study_archive';
|
||||
case ReportCreate = 'report_create';
|
||||
case ReportEdit = 'report_edit';
|
||||
case ReportDictate = 'report_dictate';
|
||||
case ReportDownload = 'report_download';
|
||||
case StudyNotesCreate = 'study_notes_create';
|
||||
|
@ -82,5 +82,13 @@ public function canReportDownload(): bool
|
||||
return $this->activeStudy(fn () => $this->study->report_status >= ReportStatus::Finalized);
|
||||
}
|
||||
|
||||
public function canReportEdit(): bool
|
||||
{
|
||||
return $this->activeStudy(fn () => $this->study->is_locked === false &&
|
||||
$this->study->report_status <= ReportStatus::Preliminary &&
|
||||
$this->study->assigned_physician_id === $this->user->id
|
||||
);
|
||||
}
|
||||
|
||||
public function __construct(private readonly Study $study) {}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public function run(): void
|
||||
}
|
||||
|
||||
$rad->givePermissionTo([
|
||||
Permission::ReportCreate,
|
||||
Permission::ReportEdit,
|
||||
Permission::ReportDownload,
|
||||
Permission::StudyDownload,
|
||||
Permission::StudyMetadataView,
|
||||
|
@ -144,7 +144,7 @@ class="d-flex justify-content-between align-items-start border-end pb-4 pb-sm-0
|
||||
|
||||
<span class="badge bg-success">Reported</span>
|
||||
|
||||
@can(\App\Domain\ACL\Permission::ReportCreate)
|
||||
@can(\App\Domain\ACL\Permission::ReportEdit)
|
||||
<a target="_blank" class="btn"
|
||||
href="{{ route('radiologist.report-write', $study->id) }}">TXT</a>
|
||||
@endcan
|
||||
|
Loading…
Reference in New Issue
Block a user