mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
login admin backend min class configurable
This commit is contained in:
@@ -547,7 +547,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
|
||||
public function canAccessAdmin(): bool
|
||||
{
|
||||
$targetClass = self::CLASS_ADMINISTRATOR;
|
||||
$targetClass = self::getAccessAdminClassMin();
|
||||
if (!$this->class || $this->class < $targetClass) {
|
||||
do_log(sprintf('user: %s, no class or class < %s, can not access admin.', $this->id, $targetClass));
|
||||
return false;
|
||||
@@ -555,6 +555,11 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getAccessAdminClassMin()
|
||||
{
|
||||
return Setting::get("system.access_admin_class_min") ?: User::CLASS_ADMINISTRATOR;
|
||||
}
|
||||
|
||||
public function isDonating(): bool
|
||||
{
|
||||
$rawDonorUntil = $this->getRawOriginal('donoruntil');
|
||||
|
||||
Reference in New Issue
Block a user