mirror of
https://github.com/maubot/rss.git
synced 2025-08-03 20:34:20 -04:00
Add internal admin list to bypass room permission checks
Pending maubot-wide access controls
This commit is contained in:
parent
b3d4482c3c
commit
b28f20da92
2 changed files with 6 additions and 0 deletions
|
@ -34,6 +34,7 @@ class Config(BaseProxyConfig):
|
|||
helper.copy("update_interval")
|
||||
helper.copy("spam_sleep")
|
||||
helper.copy("command_prefix")
|
||||
helper.copy("admins")
|
||||
|
||||
|
||||
CommandHandler = Callable[[MessageEvent, str, List[str]], Awaitable[None]]
|
||||
|
@ -181,6 +182,8 @@ class RSSBot(Plugin):
|
|||
return levels
|
||||
|
||||
async def can_manage(self, evt: MessageEvent) -> bool:
|
||||
if evt.sender in self.config["admins"]:
|
||||
return True
|
||||
levels = await self.get_power_levels(evt.room_id)
|
||||
if levels.get_user_level(evt.sender) < levels.state_default:
|
||||
await evt.reply("You don't the permission to manage the subscriptions of this room.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue