Jump to content

Add language permission for non-superusers


Nils Wiere
 Share

Recommended Posts

Hello, I’d like to give a non-superuser the possibility to add new languages and thought this is done via the lang-edit permission. However, assigning this permission to the role didn’t do the trick. There’s still no option to create a new language under Setup > Languages.

Do you have any idea on how to provide the permission to add new languages?

Link to comment
Share on other sites

This is because non-superusers aren’t allowed to add children under /processwire/setup/languages. First, because /processwire/setup/languages is of template admin, you would need to open the template settings for admin and check the box “add children” in the access tab. Then you also need to give them permission to create pages of template language, so in the language template, enable access control and check “edit pages” and “create pages”.

This isn’t a very nice solution, because you have to change access for all admin pages. I suppose it would be neat if a “lang-add” permission came with the language support module. Alternatively, you can probably write a hook to add a button somewhere that creates a language and bypasses those permission checks.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...