Skip to content

Commit 75c52bb

Browse files
authored
Fix authorization checks
1 parent b99e75c commit 75c52bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Http/Controllers/RolesController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function store(CreateRoleRequest $request) : RedirectResponse
4343
public function edit($name) : View
4444
{
4545
$role = (new Role)->with('permissions')->find($name);
46-
$this->authorize($role);
46+
$this->authorize('edit', $role);
4747
$entities = (new Entity)->whereNotIn('name', ['permission', 'entity'])->get();
4848
$actions = (new Action)->all();
4949
$ownerships = (new Ownership)->all();
@@ -73,6 +73,7 @@ public function edit($name) : View
7373
public function update(UpdateRoleRequest $request, $name) : RedirectResponse
7474
{
7575
$role = (new Role)->find($name);
76+
$this->authorize('edit', $role);
7677
$role->fill($request->only(['name', 'description']));
7778

7879
if ($request->has('permissions')) {

0 commit comments

Comments
 (0)