We need generic code that will generate a full set of permissions for every entity type.
Ideally this code would live in Entity API.
https://github.com/fago/entity/pull/9 probably has ideas worth reusing

Comments

bojanz created an issue. See original summary.

bojanz’s picture

We need to figure out the interaction between "administer $entity_type", "access $entity_type_overview", "bypass $entity_type access'.
(Which is used where, and do we need all 3?)

mglaman’s picture

This has a patch in the Entity API queue: #2801031: Provide a generic entity access handler and permissions

Once it lands just need patch here.

  • bojanz committed ab6ad25 on 8.x-2.x
    Issue #2715273 by bojanz, mglaman: Implement full permissions for every...
bojanz’s picture

Status: Active » Fixed

We decided to commit the Entity API classes into Commerce for now, for quicker iteration while the patch gets reviewed.

We'll want to add per-bundle view permissions once we add query level access.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rgpublic’s picture

Hmm. In commerce_product.routing.yml there are various permissions referenced, but they don't appear in commerce_product.permissions.yml except for one. I'm trying to give a user rights to edit products. I think the permission is called "administer commerce_product" but it doesnt appear anywhere. What am I doing wrong? Or shouldn't this work yet anyway...?

rgpublic’s picture

Ah, found it. For anyone else stranding here on this issue due to missing Commerce permissions: Make sure you use the latest Entity API:

drush up entity-8.x-1.x-dev
mglaman’s picture

drush up entity-8.x-1.x-dev

If you are using Commerce then you should be using Composer to update your dependencies, not Drush.

themic8’s picture

I'm not seeing this for orders. Has this been updated for orders?