Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow room admins to run !admin (or similar) #25

Open
ahal opened this issue Jan 16, 2023 · 3 comments
Open

Allow room admins to run !admin (or similar) #25

ahal opened this issue Jan 16, 2023 · 3 comments

Comments

@ahal
Copy link
Contributor

ahal commented Jan 16, 2023

If running a Trinity bot on a single room or smallish homeserver, having a single (or hardcoded set of) admins that can manage it is probably not a big deal. However on something the scale of e.g Mozilla's homeserver a static list of admins has some drawbacks:

  1. They would be a bottleneck
  2. They would be unable to easily administer it in a private room they were not invited to (as they wouldn't even know those rooms exist)

Ideally Trinity could support some way for room admins (or anyone above some configurable power level) to run admin commands only for the specific rooms they have permission to. I can think of two approaches:

  1. After resolving the room, Trinity verifies that the user is either a global admin of the bot OR has a high enough power level for the room being operated on. If so, proceed as normal.
  2. Create a second !room-admin (name tbd) command that only verifies the calling user's power level in the associated room. The !admin command would continue to function the exact same.

Approach 1) feels a bit cleaner and doesn't proliferate too many commands. BUT some modules may want to implement functionality that should only be configured by a global admin. Or conversely, leave it entirely up to room admins without global admins interfering. Approach 2) would give us that separation.

@bnjbvr
Copy link
Owner

bnjbvr commented Jan 16, 2023

Thanks for opening an issue! Using matrix's power levels is an idea I also had at the time of Botzilla, but never come to implement it. I actually would prefer the room's owners over a global admin (but it's also nice to have a single person or group be in charge, if room admins happen to be AFK at times when they're needed). So having both would be great!

some modules may want to implement functionality that should only be configured by a global admin

I'm just being curious: do you have any examples of such commands? I can't find such use cases. If we ever wanted to make this possible, we could also make it so that the admin entrypoint in the module interfaces takes a different input argument: it could indicate what "level" is the admin, is this the global admin, or is this just a room admin as defined by the matrix power level. Maybe there could be other ways too, like a different entrypoint room_admin, etc.

@ahal
Copy link
Contributor Author

ahal commented Jan 16, 2023

I'm just being curious: do you have any examples of such commands? I can't find such use cases

Any setting that applies globally rather than per-room is probably something we'd to keep away from room admins. For example one module I was thinking of creating would involve listening to Github webhook events and posting things like new issues / prs to the channel. The module would need to set the app id / secret of an associated Github App, which is not a setting we'd want to let room admins change.

That being said, I think #26 would more or less get rid of this problem entirely. So if we had that I think I'd agree that it's probably not worth implementing.

@ahal
Copy link
Contributor Author

ahal commented Jan 16, 2023

Maybe if you had a module and wanted to temporarily tweak a global setting it would still be useful even after #26? Like tweaking the settings of a moderation module in the midst of a spam attack for example... I'm definitely stretching here though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants