mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-03 05:41:07 +00:00
refactor(metadata): restate the legacy-era note gate definitions
This commit is contained in:
@@ -22,7 +22,12 @@ class MetadataServiceProvider extends ServiceProvider
|
||||
{
|
||||
Gate::policy(CustomField::class, CustomFieldPolicy::class);
|
||||
Gate::policy(Note::class, NotePolicy::class);
|
||||
Gate::define('manage notes', [NotePolicy::class, 'manageNotes']);
|
||||
Gate::define('view notes', [NotePolicy::class, 'viewNotes']);
|
||||
$noteAbilities = [
|
||||
'manage notes' => 'manageNotes',
|
||||
'view notes' => 'viewNotes',
|
||||
];
|
||||
foreach ($noteAbilities as $ability => $method) {
|
||||
Gate::define($ability, [NotePolicy::class, $method]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user