To simplify things, it'd be nice to tie panelizer access with access to update the node.
I figured out a semi-hackish way to do it via adding a access plugin that checked node access to current node (via menu_get_object) for current user, http://drupalcode.org/project/openatrium.git/blob/1a1e16d:/modules/featu..., and creating a pipeline that used that access check http://drupalcode.org/project/openatrium.git/blob/1a1e16d:/modules/featu...
So
- Possible to pass context to a pipeline access via the variant (so that access plugin can be removed and normal node access [assuming there is one] used instead)? It looks like work on pipelines was semi-abandoned 37 weeks ago based on that pipeline branch in panels and the open issues. (mostly unrelated, there's absolutely no cache on the cache_get level on the default hook, etc., as far as I can tell).
- Should panelizer provide a way to do it out of box? Seems very useful.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | panelizer-node-access-2024831-04.patch | 878 bytes | jhedstrom |
Comments
Comment #1
merlinofchaos commentedPanelizer already does this.
In render_entity():
Comment #2.0
(not verified) commentedremoving extra li
Comment #3
jhedstromThe logic mentioned in #1 always returns the standard renderer unless a user passes that first admin panelizer check since !FALSE evaluates to TRUE, and the operator is OR, the entity-level access check is never called.
The OR operator should be AND. I'll test and provide a patch.
Comment #4
jhedstromThis patch resolves the issue in my testing. The logic now reads "If this user doesn't have admin access AND they cannot edit the entity THEN use the standard renderer."
Comment #5
jhedstromComment #6
damienmckennaCommitted. Thanks.