Add authorization check

This commit is contained in:
Marcus Moore 2024-10-23 16:11:10 -07:00
parent e390a95bd3
commit 84f6638f50
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -47,6 +47,8 @@ class ReportTemplatesController extends Controller
public function edit($reportId): View
{
$this->authorize('reports.view');
return view('reports/custom', [
'customfields' => CustomField::get(),
'template' => ReportTemplate::findOrFail($reportId),

View file

@ -11,8 +11,6 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire
{
public function testRequiresPermission()
{
$this->markTestIncomplete('Returning 404 instead of 403...');
$this->actingAs(User::factory()->create())
->get(route('report-templates.edit', ReportTemplate::factory()->create()))
->assertForbidden();