Can we expect entity support, as I see this works only for node system.

Comments

salvis’s picture

In due time in D8: yes. At this point there is no "Entity Access" concept in core like we have Node Access.

Whether there will ever be such a thing in D7 is unknown.

kaizerking’s picture

We have a sandbox Entity access
It would be great if we can support .especially this is useful when we want to give conditional user access
a patch may be ?

salvis’s picture

No. The keyword is "in core".

There is a push to generalize D8 node access into entity access, and when that happens, ACL will follow.

I'm leaving this active because we'll surely talk more about "Entity support", but implementing it on our own (or based on a sandbox) is not an option.

mccrodp’s picture

Issue summary: View changes

Hi Salvis, has this come up in conversation since ACL has been ported to D8? (great job by id.tarzanych with your help by the way). I see Content Access D8 dev is ongoing / not officially released on the project page yet, re: #2596099: Create a D8 snapshot release.

I still have to patch and submit this for D8 #2580207: Add acl_remove_all_users function missing in D7 and D8, but I would have more involvement in testing #2596089: ACL for D8 — ALPHA1 if entity support is on the roadmap.

I have to work on #2489794: Port Message Private to Drupal 8 which could be greatly improved by ACL / Content Access for entities. However, I presume there is a substantial amount of work involved with entity integration for ACL module...?!

salvis’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

https://www.google.com/?gws_rd=ssl#q=site:drupal.org+%22entity+access%22

reveals public function Entity::access(), but I'm not sure just what it does.

I'm not sure what the present state is, but at some point when this was discussed, it was decided that adding language support to node access was more important than generalizing it to all entities, and that it was unlikely that we could have both.

Adding entity support just to ACL would not make sense, this needs to be generalized infrastructure.

mccrodp’s picture

Ok, thanks for your response. Adding language support does sound like a priority over this.

I understand it needs to be more generalised, using the core entity methods. At the very least it will involve something like the entity access method you listed and the tables will be entity_id => acl_id, so I presume it's something for 8.x-2 anyway at this stage.

fox_01’s picture

I would sponsor this feature because i need it at the moment. Please contact me for details

ndf’s picture

Added related issue.
If that lands in #3 we can use the grant access system for nodes and other entities.
before: hook_node_grants() -> after: hook_entity_grants()
before: hook_node_access_records() -> after: hook_entity_access_records()