Skip to content

Commit be6f741

Browse files
author
naresh verma
committed
fixed broken access control issue for account update
1 parent c722fcb commit be6f741

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/Webkul/Admin/src/Http/Controllers/User/AccountController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public function update()
4646
return redirect()->back();
4747
}
4848

49+
if( isset($data['role_id']) || isset($data['view_permission']) ) {
50+
session()->flash('warning', trans('admin::app.user.account.permission-denied'));
51+
52+
return redirect()->back();
53+
}
54+
4955
if (! $data['password']) {
5056
unset($data['password']);
5157
} else {
@@ -63,4 +69,4 @@ public function update()
6369

6470
return redirect()->route('admin.dashboard.index');
6571
}
66-
}
72+
}

packages/Webkul/Admin/src/Resources/lang/en/app.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@
650650
'confirm_password' => 'Confirm password',
651651
'password-match' => 'Current password does not match.',
652652
'account-save' => 'Account changes saved successfully.',
653+
'permission-denied' => 'Permission Denied'
653654
]
654655
],
655656

@@ -674,4 +675,4 @@
674675
]
675676
]
676677
];
677-
?>
678+
?>

0 commit comments

Comments
 (0)