diff --git a/src/Storage/File/Admin.php b/src/Storage/File/Admin.php index f481b14..f1051bc 100644 --- a/src/Storage/File/Admin.php +++ b/src/Storage/File/Admin.php @@ -37,9 +37,12 @@ public function getAll(ChatRoom $room): Promise return array_values(array_diff($data, $owners)); }, $this->dataFileTemplate, $room); + $siteModerators = array_keys(yield $this->aclDataAccessor->getMainSiteModerators($room)); + return [ 'owners' => $owners, 'admins' => $admins, + 'site-moderators' => $siteModerators, ]; }); } @@ -55,8 +58,9 @@ public function isAdmin(ChatRoom $room, int $userId): Promise $administrators = yield $this->getAll($room); return ($administrators['owners'] === [] && $administrators['admins'] === []) - || in_array($userId, $administrators['owners'], true) - || in_array($userId, $administrators['admins'], true); + || \in_array($userId, $administrators['owners'], true) + || \in_array($userId, $administrators['admins'], true) + || \in_array($userId, $administrators['site-moderators'], true); }); }