Entity API Change record: https://www.drupal.org/node/3002038
We need a way to secure all entity lists (not just nodes) for entities that can be grouped. So node grants is not the best option and Entity
API has recently come up with a way that allows us to alter queries more easily. Let's investigate that route or write our lightweight version of it until core supports something similar.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | group-3013678-20.patch | 28.7 KB | kristiaanvandeneynde |
Comments
Comment #2
arosboro commented@kristiaanvandeneynde do you have any WIP for this effort? I'd be happy to review.
Comment #3
kristiaanvandeneyndeTentatively scheduled for this month (Jan 2019).
Comment #4
kristiaanvandeneyndeSee: https://cgit.drupalcode.org/group?h=feature%2Fquery_access
Comment #5
chertzogLending my voice to help as needed.
Comment #6
kristiaanvandeneyndeSimple group query access has landed in a child issue (and as a result the dev branch). Note: requires Entity API.
Comment #7
bdurbin commentedHi @kristiaanvandeneynde Is this something that's already in the works, or are you looking for patches? Our team would be happy to help move this one forward, especially if it's the last remaining feature-level issue blocking a full release.
Comment #8
kristiaanvandeneyndeHi, I currently have a feature branch open for this. I did get sidetracked on the permission layer (again), but am hoping to complete it soon.
What we still need:
See #3035067: Add query access to Group entity lists for the work that has landed so far.
Comment #9
bdurbin commentedThanks for the context. The GroupContent query access handler based on the Group one makes sense. Would you mind guiding us a bit more on what you mean by a "query alter event"? It looks like hook for altering entity queries isn't yet back in D8. Is there some alternative within events that you had in mind?
Comment #10
kristiaanvandeneyndeIt's the event that allows you to alter the results generated by query access handlers. It's part of Entity API.
Comment #11
mikran commentedHi kristiaanvandeneynde,
Is that feature branch publicly available somewhere? I couldn't see it on https://git.drupalcode.org/project/group/branches at least.
Comment #12
kristiaanvandeneyndeIt got merged into RC3 already for Group entities. We need one for GroupContent and any generic content entity managed by a group now. See https://git.drupalcode.org/project/group/blob/8.x-1.x/src/Entity/Access/...
Comment #13
mikran commentedComment #14
moshe weitzman commentedLets consolidate discussion on this to one issue - #2775119: Document making custom entity types available as content for group types.
Comment #15
kristiaanvandeneyndeReopening as this issue is specifically about finishing the query access handlers and nothing else.
Comment #16
kristiaanvandeneyndeHere's a work-in-progress. It adds a handler for the GroupContent entities, but no tests yet. Posting here so people can review early and perhaps spot any errors while I write the tests.
Comment #17
kristiaanvandeneyndeThat's a typo, should be own ids. Will fix as I add tests.
Comment #18
kristiaanvandeneyndeAdds tests but still needs an any-vs-own permission test.
Comment #19
kristiaanvandeneyndeWill reroll this one with the latest permission provider work.
Comment #20
kristiaanvandeneyndeThis takes care of the GroupContent query access. Will see whether I can make any improvements for the memberships and group nodes (if need be).
Comment #21
kristiaanvandeneyndeSeems like the membership and group node queries should work just fine as the former will check for admin permissions and the latter basically extends the default permission provider 100%. I'll add an admin check to the test and call it a day.
Comment #23
kristiaanvandeneyndeAnd fixed.
Comment #24
kristiaanvandeneyndeFollow-up here: #3134072: Implement the query access handling for grouped entities
Comment #26
ajayg commentedNow this is fixed a while ago, what is preventing the official release of 8.1?
Comment #27
kristiaanvandeneynde2 patches in Entity API are blocking us. See the related issue: https://www.drupal.org/project/group/issues/3134072
Comment #28
ajayg commentedperhaps you should add on the roadmap link or main project page it is blocking the release of 8.1.