mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add authorization check
This commit is contained in:
parent
e390a95bd3
commit
84f6638f50
|
@ -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),
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue