prepare for beta8

This commit is contained in:
xiaomlove
2021-06-04 21:04:12 +08:00
parent 9a4ef55b12
commit 34a6c2e1f4
10 changed files with 100 additions and 29 deletions

View File

@@ -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;
}
}