ロール

This commit is contained in:
2025-12-29 16:25:29 +09:00
parent 8c76fe2733
commit 863bdabf59
6 changed files with 99 additions and 13 deletions

View File

@@ -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');