Closed (fixed)
Project:
Content Access
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2015 at 01:23 UTC
Updated:
3 Dec 2015 at 09:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
id.tarzanych commentedMade also some optimizations, ported Rules-related code
Comment #3
andypostneeds work at least for database usage
use \Drupal::database() for that
core use $account in most of places
Comment #4
andypostI'm pretty sure this patch should be splitted
1) code clean-up
2) rules integration
first one is a blocker for RC
Comment #5
salvisfago: Please create a D8 snapshot release!!!
id.tarzanych has commit access, but apparently he cannot create a release node.
As long as we don't have a snapshot release, we don't have anything to stand on and patches don't make much sense, whether split or in one big chunk.
Comment #6
morbus iffRandom testing note: Create a new content type. Created three nodes. Installed Content Access 8.x-1.x branch.. Removed "view" perms for that content type for anonymous and authenticated users. Saved. Cleared cache. Anonymous can not view three nodes. Yay. Authenticated can view three nodes. Boo.
Comment #7
id.tarzanych commentedThanks, I'll check that and complete tests.
There is still a lot of work to do, but 8.x-1.x-dev will provide us possibility to run automated tests on drupal.org
Comment #8
id.tarzanych commentedMorbus Iff,
I've tested Content Access for D8 too.
Module works for me, but it does not show message about node access permissions need to be rebuilt.
I'll try to fix that in my next patch.
Comment #9
morbus iff@id.tarzanych:
Hrms. I had rebuilt permissions on my end prior to doing the test.
I'll do so again shortly and report back.
Comment #10
morbus iffUsing rc3, this is still broken for me. In fact, it's gotten worse: anonymous users can now see the content. I've attached a screen of my current permissions for a content type. After rebuilding permissions on the Status report page, anonymous and authenticated are able to view any nodes of that content type.
In rc3, viewing this content type's "Access" tab also seems to cause watchdog errors, but unknown know if it's related to CA or not: User error: Invalid placeholder: !permissions in Drupal\Component\Render\FormattableMarkup::placeholderFormat() (line 240 of core/lib/Drupal/Component/Render/FormattableMarkup.php).
EDIT: Actually, I should mention that I'm using JUST the 8.x-1.x that's currently in git, NOT one that's been patched with the attached. That's probably my problem, right?
EDIT 2: Applied patch. Rebuilt permissions. Same result in rc3.
Comment #11
id.tarzanych commentedReworked module structure, made it more suitable to Drupal 8 standards, fixed FormattedMarkup compatibility and other minor bugs.
I've installed vanilla Drupal 8 from 8.0.x branch. Simpletest and manual tests went good for me
Morbus Iff,
If module still doesn't work for you, can you try to increase module's priority setting?
Comment #12
id.tarzanych commentedComment #13
andypostI think it's ready now
Comment #15
id.tarzanych commentedCommited changes.
Marking task as Active because we still need to add 8.x-1.x-dev to the list
Comment #16
jhaskins commentedHere's some more info on the issue Morbus Iff is encountering. It seems that using the role based access control settings with more than 2 roles causes the access control to fail. I was able to duplicate this on a fresh install of D8 RC3 and the most recent Content Access code.
Steps to duplicate:
If you only grant 1 or 2 roles the view any permission for the content type, it seems to work as expected. 3 or more seems to be causing problems.
Comment #17
jhaskins commentedAlright, the cause of this whole mess seems to be that content_access_optimize_grants() is assuming that the keys of $grants are gids even though they are not. I've attached a patch the fixes that assumption. I've tested it with every possible combination of role permissions I could think of and everything seems to work as expected with the patch.
Comment #18
id.tarzanych commented@jhaskins,
Thanks, Joe!
Commited your patch
But we still need Drupal 8 snapshot release....
Comment #19
francewhoaComment #20
fagoI created the snapshot release + granted id.tarzanych access to roll releases also :) Thanks!
Comment #21
id.tarzanych commentedComment #22
id.tarzanych commentedThanks, fago!