Automattic / babble

Multilingual WordPress done right.
https://wordpress.org/plugins/babble/
245 stars 50 forks source link

Translator role cannot access the translation jobs #237

Closed simonwheatley closed 9 years ago

simonwheatley commented 9 years ago

Pretty major problem. :frowning:

  1. Log in as a translator
  2. Select "Translations" from the admin menu
  3. Hit an error, rather than seeing translation jobs

"You do not have sufficient permissions to access this page."

markoheijnen commented 9 years ago

Seems I forgot to mention this. To specify, you can't access the translation job from someone else. Your own ones should be fine.

simonwheatley commented 9 years ago

@markoheijnen I'm seeing this error for accessing the list of translation jobs, at /wp-admin/edit.php?post_type=bbl_job. So the list table screen. Is that what you're seeing? Are you saying that if you have a job on that screen it works?

Any ideas for a fix?

Note I've just tested this and replicated as far back as WP 3.9 so far.

markoheijnen commented 9 years ago

I meant a different issue. Mine is for editors. I totally forgot about the fact that there is a translator role. The problem there hacky solvable to give all bbl_ permissions to the editors role.

simonwheatley commented 9 years ago

@markoheijnen Stick an issue in for your issue. :smile:

markoheijnen commented 9 years ago

Will do tomorrow with hopefully also a fix :wink:

simonwheatley commented 9 years ago

:+1:

simonwheatley commented 9 years ago

Narrowed this down a bit; when I comment out some of the code in the filter on user_has_cap, the translator is able to access the jobs list again. /cc @johnbillion

case 'edit_post':
case 'edit_bbl_job':
case 'delete_post':
case 'delete_bbl_job':
case 'publish_post':
case 'publish_bbl_job':
simonwheatley commented 9 years ago

Hmmm. I'm mistaken, it's not that code block.

johnbillion commented 9 years ago

A while ago I tracked this down to the remove_submenu_page() call in Babble_Jobs::admin_menu(). Removing it reinstates access to that menu for all users, but I haven't determined the exact cause. I waded into WordPress' menu code briefly, but soon backed out.

This looks similar to core bug #22895.