Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default site selection based on the actual user permissions #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

klemenb
Copy link

@klemenb klemenb commented Aug 2, 2018

Enupal Translate currently doesn't take into consideration which sites the user has access to and allows unauthorized users to override primary site's translations.

A simple scenario is - company X prepares a Craft installation with sites A (primary) and B. Company X gives its partner access only to site B's translations. When partner logs in, it would see only site B in the top left selector, however all of the translations made there would actually be saved under site A's language.

(Unless the partner explicitly clicks on the selector and clicks on the only entry to trigger the update of all the siteId fields in the form)

This pull request is a quick fix for our use case, but I am sure it is far from the best possible (or even complete) solution. It can serve as a beginning of a conversation towards finding a proper one.

@andrelopez andrelopez self-assigned this Aug 2, 2018
@andrelopez
Copy link
Member

Hi @klemenb

Thanks for the pull request. I'll look into this over the weekend. I'll let you know if I have any questions.

Best,
Andre L

@jhealey5
Copy link

This fix solved our problem where a legacy site couldn't save a translation unless it had full permission access to the other sites too.

+1

@andrelopez
Copy link
Member

Hi Guys @jhealey5 @klemenb,

The primary site means (what language are your templates?). However, what do you think about creating a permission where the template language can be selected (only one)? if none is detected for the user group let's leave the primary site as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants