43 lines
709 B
PHP
43 lines
709 B
PHP
<?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() {}
|
|
}
|