mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Enable superusers to actually use the is_superuser filter
This commit is contained in:
parent
fa840d79f6
commit
f739e457e4
@ -49,10 +49,13 @@ class Users extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Prevent non-superusers from even seeing the is_superuser filter
|
||||
$this->listConfig = $this->makeConfig($this->listConfig);
|
||||
$this->listConfig->filter = $this->makeConfig($this->listConfig->filter);
|
||||
unset($this->listConfig->filter->scopes['is_superuser']);
|
||||
$this->user = BackendAuth::getUser();
|
||||
if (!$this->user->isSuperUser()) {
|
||||
// Prevent non-superusers from even seeing the is_superuser filter
|
||||
$this->listConfig = $this->makeConfig($this->listConfig);
|
||||
$this->listConfig->filter = $this->makeConfig($this->listConfig->filter);
|
||||
unset($this->listConfig->filter->scopes['is_superuser']);
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user