Closed (fixed)
Project:
Entity Translation
Version:
7.x-1.x-dev
Component:
Base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2012 at 23:05 UTC
Updated:
12 Jun 2014 at 22:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachIt's by design: it's an attempt to provide a way to emulate the old translation form where only translatable fields appeared. I guess we could try to provide an update function here.
Comment #2
plachI checked the code, not sure but there might actually a bug there: the idea is that one would require the 'edit original values' permission only to access the original language, it seems to me that the code now prevents access also to translations.
Comment #3
bforchhammer commentedAttached patch provides a respective update function. It also grants the permission when the module is first installed...
Comment #4
plachI think we should take care also of comments, terms and users.
Comment #5
bforchhammer commentedAttached patch adds a few permissions for taxonomy terms and users...
This brought up a new problem: if users are made translatable then the permission essentially needs to be granted to every authenticated user, or they won't be able to edit their user profiles anymore... I guess the permission needs to be more fine-grained (i.e. per entity type, same as "translate X entities").
Comment #6
bforchhammer commentedHm, forgot to attach. Leaving NW because of the problem with user accounts...
Comment #7
bforchhammer commentedMhm.
Comment #8
plachYes, this means we probably need more granular permissions, retitling accordingly. However since the access control is governed by the
EntityTranslationHandlerInterface::getTranslationAccess()method we can override it in the various subclasses to make sure, for instance, that users can edit their own profiles or their own nodes, if they have the related permissions, and skip the 'edit original values' one.We still need an update function, obviously :)
Comment #9
bforchhammer commentedAttached patch adds a new set of permissions "edit [entity-type] original values", with the update function adjusted respectively.
I haven't overridden the getTranslationAccess() method for user entities, but instead just granted the "edit user original values" permission to all authenticated users during update/install. Do you think we should completely disable the "translation access" check for user entities?
Comment #10
plachProbably it would make sense, If I'm not mistaken one would need to grant the edit user original values permission to every user on the site, always. Hence no point to have it at all.
Wrong comment wrapping.
This should be one single line IIRC.
Missing trailing dots.
We cannot start supporting non-core entities, sorry. We may want to update the message to encourage site builders to manually update permissions for any contrib entity.
There should be an empty line between @param and @return.
Looks like $perms is never assigned.
Comment #11
bforchhammer commentedCleaned the patch up and removed the "edit user original values" permission.
Comment #12
bforchhammer commentedSetting NR...
Comment #13
plachThe patch looks good and works (almost) as intended. I performed some adjustment to permissions (creation permissions do not matter here, only edit and admin ones) and removed the special-casing of users. This looks ready to fly to me.
Comment #14
bforchhammer commentedCool, those changes make sense and look good to me. Can we use the "skip original values access" option in the default implementation of getTranslationAccess() and avoid adding the new user handler?
Comment #15
plachYes, definitely
Comment #16
bforchhammer commentedHere's a new patch based on #13 which removes the user handler.
Comment #17
plachThanks, committed the patch with a couple of small adjustments.
Comment #18
bforchhammer commentedCool, thanks! :-)