verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 33 forks source link

Make spam Keywords settings not part of project config, add as a user permission and add a link for users to access if permissions granted #241

Open terryupton opened 2 years ago

terryupton commented 2 years ago

What are you trying to do? So currently the spam keywords settings are part of the settings section in the plugin. This means, the information is synced over project config. This causes an issue in that it is most likely this information would be added in a 'live' environment, and this is counter-intuitive to how project config works and is meant to be done in local and deployed. This also means that admin users cannot access these settings, if settings are disabled on the live site (a recommended practice).

What's your proposed solution? What I propose is that access to the spam keywords settings (Moderated Keywords, Spam Keywords, Banned Keywords) is separated from the main settings. I would suggest we have a user permission flag that allows users to access this information or not, and if an admin user has permissions they can then access these options.

We would need a link within the comments section too, so this is easy to find.

Side Note: I should add that is actually possible to access the plugins settings even if admin settings are disabled by entering the url. This perhaps needs a check and an error note if admin settings are disabled, as I have seen with other plugins.

Additional context Why is this necessary? Well, it would be easiest to offload this to the admin users so they can better eliminated and reduce spam, by being able to blacklist ip addresses, emails for themselves and self manage this.

I hope this makes sense, but feel free to ping me on Discord if you want to talk it over in more depth.

engram-design commented 2 years ago

Yeah, so this is problematic because it can't really be both ways - storing in the project config and per-environment. I'd say this is almost identical to https://github.com/verbb/formie/issues/591 where my only real solution would be to include a reference to a Global Set field which is managed per-environment.

The problem really is changing it now is a breaking change. We'd have to shift them out of project config, and apply any existing ones on every environment, which would be problematic.