File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,12 +11,10 @@ class TimesheetDashboard extends Page
1111{
1212 protected static ?string $ slug = 'timesheet-dashboard ' ;
1313
14- protected static ?int $ navigationSort = 1 ;
14+ protected static ?int $ navigationSort = 2 ;
1515
1616 protected static string $ view = 'filament::pages.dashboard ' ;
1717
18- protected static bool $ shouldRegisterNavigation = false ;
19-
2018 protected function getColumns (): int | array
2119 {
2220 return 6 ;
@@ -32,6 +30,11 @@ protected static function getNavigationGroup(): ?string
3230 return __ ('Timesheet ' );
3331 }
3432
33+ protected static function shouldRegisterNavigation (): bool
34+ {
35+ return auth ()->user ()->can ('View timesheet dashboard ' );
36+ }
37+
3538 protected function getWidgets (): array
3639 {
3740 return [
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ class TimesheetResource extends Resource
2323
2424 protected static ?int $ navigationSort = 4 ;
2525
26- protected static bool $ shouldRegisterNavigation = false ;
27-
2826 protected static function getNavigationLabel (): string
2927 {
3028 return __ ('Timesheet ' );
@@ -40,6 +38,11 @@ protected static function getNavigationGroup(): ?string
4038 return __ ('Timesheet ' );
4139 }
4240
41+ protected static function shouldRegisterNavigation (): bool
42+ {
43+ return auth ()->user ()->can ('List timesheet data ' );
44+ }
45+
4346 public static function form (Form $ form ): Form
4447 {
4548 return $ form
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class PermissionsSeeder extends Seeder
2626 ];
2727
2828 private array $ extraPermissions = [
29- 'Manage general settings ' , 'Import from Jira '
29+ 'Manage general settings ' , 'Import from Jira ' ,
30+ 'List timesheet data ' , 'View timesheet dashboard '
3031 ];
3132
3233 private string $ defaultRole = 'Default role ' ;
You can’t perform that action at this time.
0 commit comments