Posted by hellolindsay on April 30, 2008 at 3:54pm
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | translation.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
There is currently only one assignable user permission for i8ns Translation module: "Translate nodes". Giving a user this permission makes the "Translation" tab appear for all translatable nodes. I would like to request the addition of a "Translate own nodes" permission which causes the "Translation" tab to show up only for those nodes owned by the user.
Comments
#1
In Drupal 6 it was easy, although I needed to change the core files. Here's the patch for it. There will "translate own content" - access right item at the admin side.
#2
Moving to correct project, Drupal core.
#3
Attached is a D7 implementation of the patch from comment #1.
#4
Looks good, but we may need a unit test case for this permission...
#5
Agreed with #4. Let's make sure we add some tests for this, and related functionality. Thanks!
#6
Attached is a simple addition to the existing translation test. A new user is created and an attempt is made to translate a node which has not been created by that user.
Please let me know if a bigger test needs to be created or something else has to be added.
#7
We should probably check for a 200 when they translate a node they do have permission to translate as well. Otherwise looks good.
#8
#9
If this is push to drupal 8 than is another 2 more years of waiting time. If each user wish to translate their own content will work better for a community, by restricting a site to a small group of trustworthy users to translate the whole community site is not very effective. Sorry i not a programmer but do hope that is can resolve. Thk!
#10
Wouldn't be possible to apply the patch on http://drupal.org/node/253157#comment-1153121 in D6 ??????
#13
I use #11 and global content translate premission is broken so all admin can't translate like what FiNeX say but using #12 got another problem, those with translate permission all turn user1 account when they try to translate node. Can someone confirm this or maybe i mess up the patch. Thank.
#14
@Spacereactor: what do you exactly mean with "all turn user1 account" ?
#15
I using manually patching your #11 and after that reset my user permission for content translate and own translate. when i user a normal account to login example user20, when i click translate node this user20 turn to user1.
#16
Probably you have some other issues on your setup: I've just tested the patch on a clean drupal installation and when I click on "translate node" the user doesn't change.
Moreover if you look at the source code of the patch you can see that it is just a check on the access control.
#17
I remove all other modules expect drupal 6.16, i18n, token, and views.
I have 4 roles, anonymous user, authenticated user, admin, contributor
Admin is set all user permissions to yes and Contributor is able to create node, edit own node, delete own node and translate own content.
I have 3 users,
user1=myself(super user)
user2=admin role
user3=contributor
After i create a new node with super user account(user1), logout from user1 and login as user3, see the node and can't translate, logout from user3 and login as user2 with admin role, user2 see the node and translate button, once click on the translate button, user2 automatic switch to user1. (something is not right here)
I use user3 with contributor role, create a new node, user1 and user2 can translate that own, but user3 can't translate own node. And when user2 try to translate the user3 node, it change to user1 when click on translate button.
Maybe i didn't apply the patch correct but this is what is getting from manual add patch #11
#18
i zip the translation.module and you can check if i mess up the manually patch.
#19
+1
#20
I've done some extra testing and I've had your same problem... I'm trying to find the problem. Thanks
#21
Please, don't use the patch I've uploaded for D6: it doesn't work and has a critical security bug.
You can try using the first patch uploaded here: http://drupal.org/node/253157#comment-1153121
P.s: why the version of this bug has been set to D8 ???
#22
@FiNeX - your comments with the patches have been removed from this issue.
dokumori
Security Team coordinator
#23
Thanks @dokumori :-)
#24
I have found that all you have to do to remove translation tabs (and translation rights) from nodes that are not assigned to people (i.e. that are not theirs to edit) is to change the function _translation_tab_access in translation.module, adding there node_access control for updating. It should look like this:
<?phpfunction _translation_tab_access($node) {
return !empty($node->language) && translation_supported_type($node->type) && node_access('view', $node) && node_access('update', $node) && user_access('translate content');
}
?>
This works well with Node Access User Reference.
PS. This goes for Drupal 6.19 + Internationalization 6.x-1.7
#25
Just a quick note for anyone else looking for this that it's been turned into a mini module http://drupal.org/project/translation_own_nodes.
#26
#27
#1: translate-own-nodes.patch queued for re-testing.
#28
The last submitted patch, translate_own_nodes.patch, failed testing.