mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 21:41:03 +08:00
prepare for beta8
This commit is contained in:
@@ -247,4 +247,14 @@ class User extends Authenticatable
|
||||
return $this->update($update);
|
||||
}
|
||||
|
||||
public function canAccessAdmin()
|
||||
{
|
||||
$targetClass = self::CLASS_MODERATOR;
|
||||
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;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user