Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing...
Transcript of Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing...
![Page 1: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/1.jpg)
www.drupaleurope.org
![Page 2: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/2.jpg)
Drupal + Technology
17/3/2018
TRACK SUPPORTED BY
![Page 3: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/3.jpg)
A crucially missing piece of the puzzleEntity access for lists
Kristiaan Van den Eynde
![Page 4: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/4.jpg)
Kristiaan Van den Eynde Senior Drupal developer
@Magentix
![Page 5: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/5.jpg)
Kristiaan Van den Eynde Work at Factorial GmbH in HamburgLive near Antwerp, BelgiumGroup module maintainerHappily married, recently a dadHighly sensitive person
![Page 6: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/6.jpg)
Definition of list access
![Page 7: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/7.jpg)
Definition of list access
Checks access before entities are loaded
![Page 8: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/8.jpg)
Definition of list access
Checks access before entities are loadedTakes caching into account
![Page 9: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/9.jpg)
Definition of list access
Checks access before entities are loadedTakes caching into accountSupported by Views
![Page 10: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/10.jpg)
Someone in the audience
But we already have that,so what's the big deal?“ “
![Page 11: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/11.jpg)
Current implementationThe node grants system
![Page 12: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/12.jpg)
What is the node grants system?
![Page 13: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/13.jpg)
What is the node grants system?
Saves business logic to the database upon node manipulation
![Page 14: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/14.jpg)
What is the node grants system?
Saves business logic to the database upon node manipulationAlters queries tagged with node_access to check for access against this saved business logic
![Page 15: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/15.jpg)
What is the node grants system?
Saves business logic to the database upon node manipulationAlters queries tagged with node_access to check for access against this saved business logicAlso used as fallback if regular access checks are indecisive
![Page 16: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/16.jpg)
What is the node grants system?
Saves business logic to the database upon node manipulationAlters queries tagged with node_access to check for access against this saved business logicAlso used as fallback if regular access checks are indecisive
Bad metaphor: Locks and keys
![Page 17: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/17.jpg)
What is the node grants system?
Saves business logic to the database upon node manipulationAlters queries tagged with node_access to check for access against this saved business logicAlso used as fallback if regular access checks are indecisive
Bad metaphor: Locks and keysBetter metaphor: Bouncers at a night club
![Page 18: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/18.jpg)
What's wrong with node grants?
![Page 19: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/19.jpg)
What's wrong with node grants?
Only work for "content" (aka nodes)
![Page 20: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/20.jpg)
What's wrong with node grants?
Only work for "content" (aka nodes)Only work for view, update and delete actions
![Page 21: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/21.jpg)
What's wrong with node grants?
Only work for "content" (aka nodes)Only work for view, update and delete actionsAs a result does not scale well for other entities
![Page 22: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/22.jpg)
What's wrong with node grants?
Only work for "content" (aka nodes)Only work for view, update and delete actionsAs a result does not scale well for other entitiesMight try and store extremely complex access logic in the DB
![Page 23: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/23.jpg)
Can it be fixed?
![Page 24: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/24.jpg)
Can it be fixed?
Not really, the concept is past its due dateWould either require a new column on existing table or one table per entity type, both are far from idealWould require a new column per supported operation, which again would lead to unwieldy (and buggy) code
![Page 25: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/25.jpg)
IntermezzoPossible approaches
![Page 26: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/26.jpg)
Keep altering queriesPros and cons
![Page 27: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/27.jpg)
Pro: We already have ENTITY_TYPE_access query tags
Pros and cons
Keep altering queries
![Page 28: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/28.jpg)
Pro: We already have ENTITY_TYPE_access query tagsPro: People are already used to this approach
Pros and cons
Keep altering queries
![Page 29: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/29.jpg)
Pro: We already have ENTITY_TYPE_access query tagsPro: People are already used to this approachCon: Complicated use cases may find themselves limited by SQL
Pros and cons
Keep altering queries
![Page 30: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/30.jpg)
Scalable paginationAccess checks in code
![Page 31: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/31.jpg)
Proposed by catch early 2017Based on a Four Kitchens blog post from 2009https://www.fourkitchens.com/blog/article/anticipage-scalable-pagination-especially-acls/
Scalable paginationAccess checks in code
![Page 32: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/32.jpg)
Scalable pagination explained
![Page 33: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/33.jpg)
Scalable pagination explained
You ask for more results than you need and pull them through your access logic
![Page 34: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/34.jpg)
Scalable pagination explained
You ask for more results than you need and pull them through your access logicIf you do not have enough results, go back to the database for more
![Page 35: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/35.jpg)
Scalable pagination explained
You ask for more results than you need and pull them through your access logicIf you do not have enough results, go back to the database for moreKeep track of the first and last item and use them for paging
![Page 36: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/36.jpg)
Scalable pagination explained
You ask for more results than you need and pull them through your access logicIf you do not have enough results, go back to the database for moreKeep track of the first and last item and use them for pagingWorks best on sites where most content is accessible to everyone
![Page 37: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/37.jpg)
Scalable paginationPros and cons
![Page 38: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/38.jpg)
Pro: Same access logic for both individual entities and entity lists
Scalable paginationPros and cons
![Page 39: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/39.jpg)
Pro: Same access logic for both individual entities and entity listsPro: No "content drift" due to Reddit-style pagers (next/previous)
Scalable paginationPros and cons
![Page 40: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/40.jpg)
Pro: Same access logic for both individual entities and entity listsPro: No "content drift" due to Reddit-style pagers (next/previous)Con: Poor performance on sites with more complex access set-ups
Scalable paginationPros and cons
![Page 41: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/41.jpg)
Pro: Same access logic for both individual entities and entity listsPro: No "content drift" due to Reddit-style pagers (next/previous)Con: Poor performance on sites with more complex access set-upsCon: No indication of amount of possible results
Scalable paginationPros and cons
![Page 42: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/42.jpg)
Pro: Same access logic for both individual entities and entity listsPro: No "content drift" due to Reddit-style pagers (next/previous)Con: Poor performance on sites with more complex access set-upsCon: No indication of amount of possible resultsCon: People are not familiar with this approach
Scalable paginationPros and cons
![Page 43: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/43.jpg)
Someone else in the audience
You don't seem to be a fan ofscalable pagination“ “
![Page 44: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/44.jpg)
Query altering: Part Deux
![Page 45: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/45.jpg)
A summary of previous work
![Page 46: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/46.jpg)
A summary of previous work
Extend the entity access system with a new grants API (and deprecate the query-alter-based node grants API)https://www.drupal.org/project/drupal/issues/777578
![Page 47: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/47.jpg)
A summary of previous work
Extend the entity access system with a new grants API (and deprecate the query-alter-based node grants API)https://www.drupal.org/project/drupal/issues/777578Entity access policieshttps://www.drupal.org/project/entity_access_policies
![Page 48: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/48.jpg)
A summary of previous work
Extend the entity access system with a new grants API (and deprecate the query-alter-based node grants API)https://www.drupal.org/project/drupal/issues/777578Entity access policieshttps://www.drupal.org/project/entity_access_policiesImplement a query-level entity access APIhttps://www.drupal.org/project/entity/issues/2909970
![Page 49: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/49.jpg)
Entity access policies
![Page 50: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/50.jpg)
Entity access policies
A collection of access plugin, e.g.: is_published
![Page 51: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/51.jpg)
Entity access policies
A collection of access plugin, e.g.: is_publishedUsed in policy config entities that list which entity types and operations they apply to
![Page 52: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/52.jpg)
Entity access policies
A collection of access plugin, e.g.: is_publishedUsed in policy config entities that list which entity types and operations they apply toWhen an entity query is launched, this system kicks in, finds all applicable policies and compiles them into one query alter
![Page 53: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/53.jpg)
Entity access policies
A collection of access plugin, e.g.: is_publishedUsed in policy config entities that list which entity types and operations they apply toWhen an entity query is launched, this system kicks in, finds all applicable policies and compiles them into one query alterYou can build a UI showing all of the active access policies for your website and even allowing you to edit them
![Page 54: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/54.jpg)
Entity access policiesPros and cons
![Page 55: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/55.jpg)
Entity access policies
Pro: Supports any operation and entity type
Pros and cons
![Page 56: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/56.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UI
Pros and cons
![Page 57: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/57.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UIPro: Works alongside node grants (until hopefully removed in D9)
Pros and cons
![Page 58: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/58.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UIPro: Works alongside node grants (until hopefully removed in D9)Pro: Easy to work around a problematic module
Pros and cons
![Page 59: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/59.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UIPro: Works alongside node grants (until hopefully removed in D9)Pro: Easy to work around a problematic moduleCon: Too big of a change at once to go into core
Pros and cons
![Page 60: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/60.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UIPro: Works alongside node grants (until hopefully removed in D9)Pro: Easy to work around a problematic moduleCon: Too big of a change at once to go into coreCon: Loads a list of config entities to decide access to another list of entities
Pros and cons
![Page 61: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/61.jpg)
Entity access policies
Pro: Supports any operation and entity typePro: Option to have an access overview UIPro: Works alongside node grants (until hopefully removed in D9)Pro: Easy to work around a problematic moduleCon: Too big of a change at once to go into coreCon: Loads a list of config entities to decide access to another list of entitiesCon: Nowhere near finished
Pros and cons
![Page 62: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/62.jpg)
A query-level entity access API
![Page 63: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/63.jpg)
A query-level entity access API
Registered as an entity type handler
![Page 64: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/64.jpg)
A query-level entity access API
Registered as an entity type handlerGenerates conditions based on the user's permissions which are ultimately added to the query
![Page 65: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/65.jpg)
A query-level entity access API
Registered as an entity type handlerGenerates conditions based on the user's permissions which are ultimately added to the queryFires an event to alter the conditions (so before query alter)
![Page 66: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/66.jpg)
A query-level entity access API
Registered as an entity type handlerGenerates conditions based on the user's permissions which are ultimately added to the queryFires an event to alter the conditions (so before query alter)Works for Views and entity queries
![Page 67: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/67.jpg)
Pros and cons
A query-level entity access API
![Page 68: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/68.jpg)
Pro: Familiar approach (entity handlers)
Pros and cons
A query-level entity access API
![Page 69: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/69.jpg)
Pro: Familiar approach (entity handlers)Pro: Works well for most scenarios out of the box
Pros and cons
A query-level entity access API
![Page 70: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/70.jpg)
Pro: Familiar approach (entity handlers)Pro: Works well for most scenarios out of the boxPro: Small enough in scope to make it into core
Pros and cons
A query-level entity access API
![Page 71: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/71.jpg)
Pro: Familiar approach (entity handlers)Pro: Works well for most scenarios out of the boxPro: Small enough in scope to make it into coreCon: Relies on a permission handler that hasn't made it to core yet
Pros and cons
A query-level entity access API
![Page 72: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/72.jpg)
Pro: Familiar approach (entity handlers)Pro: Works well for most scenarios out of the boxPro: Small enough in scope to make it into coreCon: Relies on a permission handler that hasn't made it to core yetCon: Hard to alter or prevent another module's access logic
Pros and cons
A query-level entity access API
![Page 73: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/73.jpg)
Good news everyone
![Page 74: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/74.jpg)
Work on query access handler to be committed to Entity API within a weekPermission handler on a fast-track to be added to core https://www.drupal.org/node/2809177This paves the way for adding the query access handlers to coreLikely in Drupal 8.7.0
Roadmap
![Page 75: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/75.jpg)
Become a Drupal contributor Friday from 9am
● First timers workshop● Mentored contribution● General contribution
![Page 76: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/76.jpg)
Thank you!
![Page 77: Drupal + Technology€¦ · Drupal + Technology 17/3/2018 TRACK SUPPORTED BY. A crucially missing piece of the puzzle Entity access for lists Kristiaan Van den Eynde. Kristiaan Van](https://reader034.fdocuments.us/reader034/viewer/2022051815/603d71a9a9a8f651e823db2b/html5/thumbnails/77.jpg)
Questions?