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