This module can provide an excellent solution to handle language restrictions on content but I'm currently blocked as the module doesn't handle revision handling.
A user with language restrictions can access and revert revisions for al languages.

Comments

JurgenR created an issue. See original summary.

weseze’s picture

StatusFileSize
new5.72 KB

Attached is POC patch.

Is this the correct way forward for this? Would this be considered for inclusion?

weseze’s picture

Status: Active » Needs review
heddn’s picture

Status: Needs review » Needs work
+++ b/src/Access/NodeRevisionAccessCheck.php
@@ -0,0 +1,139 @@
+class NodeRevisionAccessCheck extends \Drupal\node\Access\NodeRevisionAccessCheck {
...
+      return AccessResult::allowedIf($node && $this->checkAccess($node, $account, $operation))->cachePerPermissions()->addCacheableDependency($node);

Instead of extending NodeRevisionAccessCheck, I think it would be cleaner to extend this module's base class and injecting the access_check.node.revision service and calling it's checkAccess method.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new6.04 KB
new4.31 KB
nterbogt’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm not sure we want to be able to restrict permissions based on languages. The revisions list allows you to see the revisions that have past, view the content in them, and possibly revert.

The problem is, a revision is generally created per language change so that the history looks like:

* en
* en
* fr
* en
* fr

Now if you were to allow a user to revert to the first french revision, you'd find that two en changes that follow it would be reverted. There's no easy way around this so I believe that the module shouldn't actually change permissions for revisions. There is already a 'view revisions' permission and it should be deemed a language unsafe action, and only given to higher level users.

Happy for feedback, or if my understanding is incorrect, but would like to look at it further before catering for language based permissions on revisions.

heddn’s picture

#6 seems fair to me. Closed, won't fix?

nterbogt’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Happy to look at it again if additional information comes to light.

bingol@ciandt.com’s picture

StatusFileSize
new1.13 KB
bingol@ciandt.com’s picture

bingol@ciandt.com’s picture

StatusFileSize
new1.54 KB
bingol@ciandt.com’s picture

StatusFileSize
new1.71 KB