feat: add private existing business draft foundation
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\ExistingBusiness;
|
||||
use App\Models\User;
|
||||
|
||||
class ExistingBusinessPolicy
|
||||
{
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->hasVerifiedEmail();
|
||||
}
|
||||
|
||||
public function update(User $user, ExistingBusiness $business): bool
|
||||
{
|
||||
return $user->hasVerifiedEmail() && $business->owner_user_id === $user->id && ! $business->trashed();
|
||||
}
|
||||
|
||||
public function view(User $user, ExistingBusiness $business): bool
|
||||
{
|
||||
return $this->update($user, $business);
|
||||
}
|
||||
|
||||
public function delete(User $user, ExistingBusiness $business): bool
|
||||
{
|
||||
return $this->update($user, $business);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user