mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
32 lines
596 B
PHP
32 lines
596 B
PHP
<?php
|
|
|
|
namespace InvoiceShelf\Policies;
|
|
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
use InvoiceShelf\Models\Note;
|
|
use InvoiceShelf\Models\User;
|
|
use Silber\Bouncer\BouncerFacade;
|
|
|
|
class NotePolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
public function manageNotes(User $user)
|
|
{
|
|
if (BouncerFacade::can('manage-all-notes', Note::class)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public function viewNotes(User $user)
|
|
{
|
|
if (BouncerFacade::can('view-all-notes', Note::class)) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|