Refactor everything to be service based so it can be overridden.
Decomplicate permission checks.
Fix cache issues.
Check permissions on menu items (but not menu edit form, just yet).

Comments

nterbogt created an issue. See original summary.

nterbogt’s picture

  • nterbogt authored a59ce56 on 2.x
    Issue #3179076 by nterbogt: Service refactor
    
nterbogt’s picture

Status: Active » Needs review

The 2.x-dev release needs review by other module users.

heddn’s picture

Issue summary: View changes
StatusFileSize
new54.02 KB
new61.55 KB

Not sure it matters, but I'm running 9.1.0-rc1.

I think I found an issue. Let me see if I can coherantly describe how to reproduce. Grant a user a role that gives them ability to translate a language. But don't give them permission to the source language. Only the destination. (destination = Castilian Spanish, source = world-wide English).

If a translation does not exist yet and I don't have access to both the source and destination languages, then the save button on the page doesn't surface.

ContentTranslationController:add() calls $form_state_additions['content_translation']['translation_form'] = !$entity->access('update');. This in turn eventually calls allowed_languages_entity_access. But the entity passed in has world-wide english, not castilian spanish. So access is denied and the save button on the node is hidden later by ContentTranslationHandler::entityFormSharedElements().

heddn’s picture

heddn’s picture

Status: Needs review » Fixed

This has a commit. And looks fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.