reupload
This commit is contained in:
42
app/Permissions/User/UserProductPermissionChecker.php
Normal file
42
app/Permissions/User/UserProductPermissionChecker.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Permissions\User;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class UserProductPermissionChecker
|
||||
{
|
||||
/**
|
||||
* Does have channel
|
||||
*/
|
||||
protected bool $hasChannel = false;
|
||||
|
||||
/**
|
||||
* Users channel
|
||||
*/
|
||||
protected $channel;
|
||||
|
||||
/**
|
||||
* Permission checker for user's products
|
||||
*/
|
||||
public function __construct(
|
||||
protected User $user
|
||||
) {
|
||||
$this->checkIfHasChannel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check If Has Channel
|
||||
*/
|
||||
public function checkIfHasChannel(): bool
|
||||
{
|
||||
$this->channel = $this->user->channel();
|
||||
|
||||
return $this->channel ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all user's products
|
||||
*/
|
||||
public function saveAllProductIds() {}
|
||||
}
|
||||
Reference in New Issue
Block a user