Limit Translator use to certain groups only

Hi,

I have rather unusual question. Is it possible to make plugin allowed to use to users from specific groups only? Long story short: the community is very big, the demand for translation grows, so do our costs too. In our community, we have paid users which belong to specific groups. The idea is to limit the translator usage to these specific groups if it is possible to do.

I don’t mind converting this request into Marketplace topic, I just want to hear any ideas on where to dig to achieve the desired outcome described above.

3 Likes

There’s not currently a way to limit a plugin to only a specific group, it could be added as a feature to any individual plugin, but would take a little work.

Without adding functionality to the existing plugin, this could be done within a theme…

We have a theme component that adds all of a user’s groups to the body tag: CSS Classes for Current User's Groups

Using this you could hide the translator button for all users that aren’t in a specific group:

body:not(.group-example) {
  .post-controls .translate {
    display: none; 
  }
}

In that example, the translate button below a post would be hidden for anyone not in the “example” group.

A savvy visitor could discover the translate button in their browser’s inspector, so it’s not as comprehensive as a solution directly in the plugin, but it might work well enough for your case.

3 Likes

Hey @awesomerobot

Thank you for your reply. Yes, CSS limitation was the last resort for me, but in the same time, it’s a good way for us to test it. The thing is, we’d like to have functionality, limiting the usage of inline translation with explicit warning that the feature is “premium-only”, which we intended to display when a user outside of specific groups try to use it.

Thank you for your CSS example!

I think we will dive into Our solution for blurring NSFW content idea and combine these two :slight_smile:

1 Like