mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-05 12:08:58 +00:00
Fix #176
This commit is contained in:
@@ -169,9 +169,13 @@ class UserController extends Controller
|
||||
// 只有超级管理员才能赋予超级管理员
|
||||
$roles = $request->input('roles');
|
||||
try {
|
||||
if ($roles && (Auth::getUser()->can('give roles') || (in_array('Super Admin', $roles, true)
|
||||
&& Auth::getUser()->hasRole('Super Admin')) || Auth::getUser()->hasRole('Super Admin'))) {
|
||||
$user->syncRoles($roles);
|
||||
if (isset($roles)) {
|
||||
if (Auth::getUser()->can('give roles') || Auth::getUser()->hasRole('Super Admin')
|
||||
|| (in_array('Super Admin', $roles, true) && Auth::getUser()->hasRole('Super Admin'))) {
|
||||
$user->syncRoles($roles);
|
||||
}
|
||||
} else {
|
||||
$user->roles()->detach();
|
||||
}
|
||||
|
||||
// Input checking for dummy
|
||||
|
||||
@@ -32,4 +32,4 @@ return [
|
||||
'download' => '下载',
|
||||
'total' => '总计',
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user