@@ -48,7 +48,7 @@ public static function getNavigationGroup(): ?string
4848
4949 public static function canAccess (): bool
5050 {
51- return user ()?->can('view legalPages ' );
51+ return user ()?->can('view legalPage ' );
5252 }
5353
5454 public function mount (): void
@@ -74,6 +74,7 @@ public function getFormSchema(): array
7474 foreach (LegalPageType::cases () as $ legalPageType ) {
7575 $ schema [] = MarkdownEditor::make ($ legalPageType ->getId ())
7676 ->label ($ legalPageType ->getLabel ())
77+ ->disabled (fn () => !user ()?->can('update legalPage ' ))
7778 ->hintActions ([
7879 Action::make ('view ' )
7980 ->label (trans ('filament-actions::view.single.label ' ))
@@ -82,6 +83,7 @@ public function getFormSchema(): array
8283 ->visible (fn (Get $ get ) => $ get ($ legalPageType ->getId ())),
8384 Action::make ('clear ' )
8485 ->label (trans ('legal-pages::strings.clear ' ))
86+ ->authorize (fn () => user ()?->can('update legalPage ' ))
8587 ->color ('danger ' )
8688 ->icon ('tabler-trash ' )
8789 ->action (fn (Set $ set ) => $ set ($ legalPageType ->getId (), null )),
@@ -101,6 +103,7 @@ protected function getHeaderActions(): array
101103 return [
102104 Action::make ('save ' )
103105 ->label (trans ('filament-panels::resources/pages/edit-record.form.actions.save.label ' ))
106+ ->authorize (fn () => user ()?->can('update legalPage ' ))
104107 ->action ('save ' )
105108 ->keyBindings (['mod+s ' ]),
106109 ];
0 commit comments