Wishlists don't implement EntityOwnerInterface because orders don't.
However, orders don't because the customer isn't able to freely change their order once it has been placed.
There is no such restriction here, the customer can always modify their own wishlist.
So, let's implement EntityOwnerInterface and remove the customer methods.
We should also add uid and owner entity keys, like we did for products and variations in https://www.drupal.org/project/commerce/issues/3007275#comment-12822472

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Note that this will also simplify permissions, since we'll no longer need to declare our "own" permission.

czigor’s picture

bojanz’s picture

We can remove WishlistAccessControlHandler and WishlistPermissionProvider completely.

czigor’s picture

bojanz’s picture

Status: Needs review » Needs work
- *     "access" = "Drupal\commerce_wishlist\WishlistAccessControlHandler",
- *     "permission_provider" = "Drupal\commerce_wishlist\WishlistPermissionProvider",

Not like that :) We still need to specify the previous parents.

czigor’s picture

Status: Needs work » Needs review
FileSize
9.76 KB

Ah ok, fixed it.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good now.

  • agoradesign committed 3f0bad0 on 8.x-3.x authored by czigor
    Issue #3023998 by czigor, bojanz: Wishlists should implement...
agoradesign’s picture

Status: Reviewed & tested by the community » Fixed

keep pushin' on...

bojanz’s picture

Status: Fixed » Needs work

We forgot a bit:

We should also add uid and owner entity keys, like we did for products and variations in https://www.drupal.org/project/commerce/issues/3007275#comment-12822472

Query access will crash without those.

czigor’s picture

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

  • agoradesign committed 11a2ae6 on 8.x-3.x authored by czigor
    Issue #3023998 by czigor, bojanz: Wishlists should implement...
bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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

jsacksick’s picture

Was there any particular reason for not using EntityOwnerTrait??

agoradesign’s picture

hmm I guess that trait didn't exist at that time

jsacksick’s picture