3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-04-26 01:35:21 +00:00

Fix issues with update permission naming (#7493)

This solves an issue when admin would be able to create and delete
categories but not edit them.
This commit is contained in:
Marián Skrip
2019-10-28 19:44:48 +01:00
committed by snipe
parent a90149940a
commit 53eae6fbfd
5 changed files with 11 additions and 15 deletions

View File

@ -370,7 +370,7 @@ class UsersController extends Controller
*/
public function getRestore($id = null)
{
$this->authorize('edit', User::class);
$this->authorize('update', User::class);
// Get user information
if (!$user = User::onlyTrashed()->find($id)) {
return redirect()->route('users.index')->with('error', trans('admin/users/messages.user_not_found'));
@ -421,7 +421,7 @@ class UsersController extends Controller
try {
// Get user information
$user = User::findOrFail($id);
$this->authorize('edit', $user);
$this->authorize('update', $user);
// Check if we are not trying to unsuspend ourselves
if ($user->id === Auth::id()) {