- πΊπΈ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
10 months ago 4:51pm 12 February 2024 - last update
10 months ago 152 pass - last update
10 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 βΊοΈ - First commit to issue fork.
- πΊπΈUnited States nicxvan
nicxvan β changed the visibility of the branch 8.x-1.x to hidden.
- πΊπΈUnited States nicxvan
nicxvan β changed the visibility of the branch 3023527-add-view-any to hidden.
- πΊπΈUnited States nicxvan
I'm going to see if I can refresh this and take a look if the feedback has been addressed.
I'm hiding the patches so we can make sure the work stays in the same MR the patches seem to have diverged from the MR so I created a new one starting with patch in 50.
- πΊπΈUnited States nicxvan
Ok I hope it is ok to still mark this, I only updated test variables to the ones they were clearly meant to be.
I went through it and it looks right.
I manually tested it too.
The cache contexts look like they were updated properly
I did change the variables in the test because they were named wrong.Tests pass and the test only job fails.