improved widget/report permissions
This commit is contained in:
@ -10,7 +10,6 @@ use App\Jobs\Common\UpdateDashboard;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Common\Dashboard;
|
||||
use App\Models\Common\Widget;
|
||||
use App\Models\Module\Module;
|
||||
use App\Traits\DateTime;
|
||||
use App\Traits\Users;
|
||||
use App\Utilities\Widgets;
|
||||
@ -69,13 +68,7 @@ class Dashboards extends Controller
|
||||
}
|
||||
|
||||
$widgets = Widget::where('dashboard_id', $dashboard->id)->orderBy('sort', 'asc')->get()->filter(function ($widget) {
|
||||
if ($alias = Widgets::getModuleAlias($widget->class)) {
|
||||
if (!Module::alias($alias)->enabled()->first()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return Widgets::canRead($widget->class);
|
||||
return Widgets::canShow($widget->class);
|
||||
});
|
||||
|
||||
$financial_start = $this->getFinancialStart()->format('Y-m-d');
|
||||
|
Reference in New Issue
Block a user