improved widget/report permissions

This commit is contained in:
Denis Duliçi
2020-06-13 00:13:39 +03:00
parent 6ca0ec5522
commit e1743e1f8f
4 changed files with 65 additions and 18 deletions

View File

@ -25,7 +25,7 @@ class Reports extends Controller
$reports = Report::orderBy('name')->get();
foreach ($reports as $report) {
if (!Utility::canRead($report->class)) {
if (!Utility::canShow($report->class)) {
continue;
}
@ -56,7 +56,7 @@ class Reports extends Controller
*/
public function show(Report $report)
{
if (!Utility::canRead($report->class)) {
if (!Utility::canShow($report->class)) {
abort(403);
}
@ -203,7 +203,7 @@ class Reports extends Controller
*/
public function print(Report $report)
{
if (!Utility::canRead($report->class)) {
if (!Utility::canShow($report->class)) {
abort(403);
}
@ -218,7 +218,7 @@ class Reports extends Controller
*/
public function export(Report $report)
{
if (!Utility::canRead($report->class)) {
if (!Utility::canShow($report->class)) {
abort(403);
}
@ -263,7 +263,7 @@ class Reports extends Controller
public function clear()
{
Report::all()->each(function ($report) {
if (!Utility::canRead($report->class)) {
if (!Utility::canShow($report->class)) {
return;
}