mikeshardmind / SinbadCogs

A set of community resources
Apache License 2.0
50 stars 47 forks source link

[RoleManagement] Feature Request: Roles should be removed if required roles are removed. #241

Closed ghost closed 4 years ago

ghost commented 4 years ago

Is your feature request related to a problem? If so, Please describe. Role A depends on Role B. If the user loses Role B, Role A stays.

Describe the solution you'd like Role A should be removed when Role B is removed since the latter is a requirement.

Describe alternatives you've considered if any N/A

Additional context Testing was done using requireany.

mikeshardmind commented 4 years ago

This has been on my radar for a small bit of time already, but I need to come up with consistent handling of this which properly interacts with all of the other settings without causing a performance drain, which might require slightly more work. (large public instances of red use this cog, so if this becomes too intensive on role removal, this will be an issue)

I'm placing this as a medium-high priority, but compliance with the new discord terms (both with the stuff I'm contributing to core red, and the adjustments to #236 that will be needed) is above this in the list of larger things to handle.

DiscordLiz commented 4 years ago

How hard would it be to re-use the extension component from the automod tools? I know you weren't ready to publish that, but it's working and faster than anything else we've tried.

mikeshardmind commented 4 years ago

Without testing it, I'm assuming it won't be worth it. The main performance concern is config access, and caching would be irresponsible here. Maybe if I can express this as a single efficient SQL statement, but even that has issues since i would need to have array types and red cant guarantee anything more than sqlite