Access plugin lets you create editors for specific languages and enables them to review and publish translations of specific content types.
Normally, if you want to set a user as an editor for a language, then this user has to be an administrator of the entire site. Access provides the functionality to set access rules for specific user roles or individual users on specific content types and languages.
Let’s assume that we have created a Book custom post type, which can be translated, and we have enabled English and German as the default and an additional language respectively.
Our final goal is a system where someone can create books and send translation jobs, someone else can submit translations for review and another user is responsible for editing and publishing these translations. The permissions for each user are illustrated in the following table:
|admin||administrator||Can manage books, can manage translations for books in all languages, can manage users & translators|
|german_editor||Subscriber||Can edit and publish translations for books only in German language|
|german_translator||Subscriber||Can submit translations for books in draft status only in German language|
There are three main steps in order to achieve our goal. Through this guide, we will:
- create the required users and roles
- setup translator in WPML
- configure Access for language editor
The first step is to create the users of the site. The admin will have an administrator role and will have the permission to create and edit any books or translations. For the editor and the translator, it is recommended to assign the subscriber role to them, as this ensures that they will only have the permissions that we will assign to them in the following sections.
Let us assume that we have already enabled English and German languages in our site, setting the former as the default one.
It is also important to set that translations will be submitted as drafts in the WPML settings. To do this, navigate to the WPML -> Settings page and scroll to the Translated documents options section. There, check Draft in the Document Status setting.
The next step is to set the german_translator as the translator from English to the German language. This can be done in WPML -> Translation Management -> Translation Roles.
Now, german_translator is allowed to take up German to English translation jobs and submit them in draft status. You can read more about translation management features in the official documentation.
At this point, we will use Access functionality to create a group of permissions for the german_editor user. These permissions will apply to Book custom post type only for the selected languages, which in our case is German.
In order for the permissions to be active, we must enable Managed by Access option for Books.
We can now create a new group of permissions. In the WPML Groups tab, we click on the button to create permission for a specific language.
After we select the appropriate custom post type and language, we are ready to start setting up permissions for a specific user.
In order to set a user as a language editor, click the icon at the bottom of the column for each permission and type the username in the dialog’s text field. Access will auto-complete and let you select the user.
We have just enabled german_editor to edit, delete and publish any translation in German language.
Now that we have the desired functionality, we can see our system in action. Let’s assume a scenario where admin creates a new book, sends a job to german_translator to submit the German text, and finally german_editor reviews this translation and publishes it online.
The following table illustrates the steps for this scenario and describes the process to complete it.
|Administrator creates and publishes a new book.|
|Administrator creates a new translation job for the book and sends it to the translator.
You can find more information about WPML Translation Management in the official documentation.
|Translator receives a new entry in books list and only has the permission to add a German translation for this book.|
|Translator inserts the German text and submits the translation.|
|Editor uses the language switcher in order to check and edit the translations.|
|Editor checks the list of translated books and only has the permission to edit and publish German translations.|
|Administrator checks the list of books and has the permission to edit all entries in all languages.|