minor
This commit is contained in:
parent
a3a8480b6f
commit
1d123b845a
@ -367,4 +367,13 @@ protected function casts(): array
|
|||||||
'patient_birthdate' => 'immutable_date',
|
'patient_birthdate' => 'immutable_date',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isLockedBy(?User $user): bool
|
||||||
|
{
|
||||||
|
if ($user === null) {
|
||||||
|
$user = auth()->user();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->locking_physician_id === $user->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,8 @@ public function canReportEdit(): bool
|
|||||||
|
|
||||||
public function canUnlockReport(): bool
|
public function canUnlockReport(): bool
|
||||||
{
|
{
|
||||||
return $this->activeStudy(fn () => $this->study->isLocked() && $this->study->locking_physician_id === $this->user->id);
|
return $this->activeStudy(fn () => $this->study->isLocked()
|
||||||
|
&& $this->study->locking_physician_id === $this->user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkUserPermission(Permission $permission): bool
|
private function checkUserPermission(Permission $permission): bool
|
||||||
|
Loading…
Reference in New Issue
Block a user