mirror of
https://github.com/maubot/rss.git
synced 2024-10-01 08:25:36 -04:00
Check specific permission for RSS management
This commit is contained in:
parent
6dbb12f2d4
commit
e92d8fceb9
@ -161,8 +161,12 @@ class RSSBot(Plugin):
|
||||
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.")
|
||||
user_level = levels.get_user_level(evt.sender)
|
||||
state_level = levels.events.get("xyz.maubot.rss", levels.state_default)
|
||||
if type(state_level) != int:
|
||||
state_level = 50
|
||||
if user_level < state_level:
|
||||
await evt.reply("You don't have the permission to manage the subscriptions of this room.")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user