- πΊπΈUnited States mglaman WI, USA
so that we fetch both published and unpublished product when the current user has the view any unpublished product permission.
Yes, I agreed w/ @Berdir that the query conditions could be optimized based on earlier logic checks.
if ($has_owner && $account->hasPermission("view any unpublished $entity_type_id")) {
If the user has the
view any
permisison, why do we care about$has_owner
? This seems like a candidate for if/elseif/elseif ($account->hasPermission("view any unpublished $entity_type_id")) { } elseif ($has_owner && $account->hasPermission("view own unpublished $entity_type_id") { } else { // published logic }
- π¬π·Greece s.messaris
Opened the issue fork and added a commit based on #27, implementing some of the optimization mglaman suggested in #39.
Leaving in "needs work" because I feel it can be optimized further.
Also we might want to add "view any unpubliched $bundle $type" permissions as well.
- Status changed to Needs review
9 months ago 4:51pm 12 February 2024 - last update
9 months ago 152 pass - last update
9 months ago Patch Failed to Apply - πΊπ¦Ukraine khiminrm
Hi! Could someone from the maintainers review the latest patch and leave feedback what's need to be done else e.g. https://www.drupal.org/project/entity/issues/3023527#comment-15157931 β¨ Add: "View any unpublished [entity_type]" permission Needs review or it can be merged as is? Thanks!
- ππΊHungary fox mulder
#42 β¨ Add: "View any unpublished [entity_type]" permission Needs review works as expected
core: 10.2.3
entity: 8.x-1.4 - π©πͺGermany tomsaw Essen
Nice patch! #47 worked over here.
Thanks community βΊοΈ - π¦π·Argentina OPtii
It doesn't work on core 10.2.7. Any help pls?