wip
This commit is contained in:
26
app/Models/Concerns/InteractsWithNova.php
Normal file
26
app/Models/Concerns/InteractsWithNova.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Concerns;
|
||||
|
||||
trait InteractsWithNova
|
||||
{
|
||||
/**
|
||||
* Check if user can access nova
|
||||
*/
|
||||
public function canAccessNova(): bool
|
||||
{
|
||||
if ($this->isMe()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->hasRole(['admin', 'manager'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->hasRole('vendor') && $this->channel()->id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user