mirror of
https://github.com/maubot/rss.git
synced 2025-02-03 03:40:03 -05:00
Add internal admin list to bypass room permission checks
Pending maubot-wide access controls
This commit is contained in:
parent
b3d4482c3c
commit
b28f20da92
@ -5,3 +5,6 @@ update_interval: 60
|
||||
spam_sleep: 2
|
||||
# The prefix for all commands
|
||||
command_prefix: "!rss"
|
||||
# Users who can bypass room permission checks
|
||||
admins:
|
||||
- "@user:example.com"
|
||||
|
@ -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…
x
Reference in New Issue
Block a user