This commit is contained in:
2024-11-07 10:25:23 +05:00
parent 0744b372d4
commit c7b819f6c1

View File

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Gate;
trait NovaSberPaymentOrderAuth trait NovaSberPaymentOrderAuth
{ {
/** View */
public function authorizeToView(Request $request) public function authorizeToView(Request $request)
{ {
$user = auth()->user(); $user = auth()->user();
@@ -23,9 +24,7 @@ trait NovaSberPaymentOrderAuth
throw new AuthorizationException(); throw new AuthorizationException();
} }
/** /** Edit button */
* Edit button
*/
public function authorizedToUpdate(Request $request): bool public function authorizedToUpdate(Request $request): bool
{ {
$user = auth()->user(); $user = auth()->user();
@@ -37,9 +36,7 @@ trait NovaSberPaymentOrderAuth
return false; return false;
} }
/** /** Update */
* Edit proceess
*/
public function authorizeToUpdate(Request $request): void public function authorizeToUpdate(Request $request): void
{ {
$user = auth()->user(); $user = auth()->user();
@@ -55,9 +52,7 @@ trait NovaSberPaymentOrderAuth
throw new AuthorizationException(); throw new AuthorizationException();
} }
/** /** Delete button */
* Delete button
*/
public function authorizedToDelete(Request $request) public function authorizedToDelete(Request $request)
{ {
$user = auth()->user(); $user = auth()->user();
@@ -69,6 +64,7 @@ trait NovaSberPaymentOrderAuth
return false; return false;
} }
/** Delete */
public function authorizeToDelete(Request $request) public function authorizeToDelete(Request $request)
{ {
$user = auth()->user(); $user = auth()->user();
@@ -80,6 +76,7 @@ trait NovaSberPaymentOrderAuth
throw new AuthorizationException(); throw new AuthorizationException();
} }
/** Force delete */
public function authorizedToForceDelete(Request $request) public function authorizedToForceDelete(Request $request)
{ {
throw_unless(auth()->user()->isMe(), AuthorizationException::class); throw_unless(auth()->user()->isMe(), AuthorizationException::class);