1 package SL::InstanceState;
5 use SL::DB::Manager::Employee;
7 use parent qw(Rose::Object);
10 sub has_employee_project_invoices {
11 SL::DB::Manager::Employee->current && @{SL::DB::Manager::Employee->current->project_invoice_permissions};
25 SL::InstanceState - Provides instance-specific status information
29 While instance configuration settings are provided via C<SL::InstanceConf>,
30 this module provides non-configuration information of the instance.
32 The intention is to use the state information in the menu, e.g. to enable
33 or disable some menu entries if some condition is met.
35 Example: If a user has no right to see invoices, the menu entry for this report
36 was shown anyway, because the user may has the right to access project invoices.
37 Now, the display of the menu entry can be made dependent on the status.
44 =item C<has_employee_project_invoices>
46 Returns trueish if the current employee has the right to access
47 some project invoices.
53 As for now, no global instance of this class is provided. If this information
54 should be used in e.g. templates or some other programm code, then a global
55 instance may should be provided.
63 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>