ロール
This commit is contained in:
@@ -10,8 +10,8 @@ class BlogPost {
|
||||
public function getPosts(string $section, ?\stdClass $user): array {
|
||||
$path = ROOT.$section;
|
||||
$posts = [];
|
||||
$isMember = $user !== NULL;
|
||||
$isStaff = $user !== NULL && $user->role === 1;
|
||||
$isMember = $user !== NULL && $user->role !== \Roles::BANNED;
|
||||
$isStaff = $user !== NULL && $user->role & (\Roles::ADMIN | \Roles::STAFF);
|
||||
|
||||
if (!is_dir($path)) return $posts;
|
||||
$files = glob($path.'/*.md');
|
||||
|
||||
Reference in New Issue
Block a user