mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
v5.0.0 update
This commit is contained in:
31
app/Policies/NotePolicy.php
Normal file
31
app/Policies/NotePolicy.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Policies;
|
||||
|
||||
use Crater\Models\Note;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user