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:
@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user