Needs work
Project:
Scheduled Transitions
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2019 at 08:05 UTC
Updated:
13 Feb 2026 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rp7 commentedA first attempt at this, be gentle :-)
I had (possibly still have) a hard time grasping my head around access mirroring.
Comment #3
rp7 commentedComment #5
rp7 commentedFixing a few tests. Still WIP.
Comment #6
dpiAre you sure this is true?
I think if the user has access to delete the associated entity, they will also have access to delete the scheduled transition.
Understandably having permission to do both isnt always desired, perhaps this issue should be about implementing mirror operation functionality?
As far as the patch approach goes, take a look at ScheduledTransitionsRouteProvider.php and copy the _entity_access things from there, and override the
getDeleteFormRoutemethod. Changes to\Drupal\scheduled_transitions\ScheduledTransitionsAccessControlHandler::checkAccessare not necessary.You basically need to add an extra Delete section whereever the existing Add/View operation logic happens, there shouldnt be any Delete specific code (e.g new code in
ScheduledTransitionsAccessControlHandler::checkAccess)config/install/scheduled_transitions.settings.yml needs to be modified and an update path for existing sites is required. Mirror 'delete' to 'update' sounds logical.
Comment #7
rp7 commentedRe-rolled patch against latest dev.
@dpi You may very well be right. I'll have to investigate it further. I'm hopeful I can find some time soon.
Comment #8
dpiSimilar work is undertaken in #3119360: Reschedule transitions, which will be posted in the near future.
Comment #9
rp7 commentedHi @dpi
Correct.
Correct.
Re-rolled patch against 2.x & is now more in line with the solution in #3119360: Reschedule transitions. The upgrade path (update hook) is probably not complete yet.
Bare in mind that this functionality is also impacted by the issue mentioned in #3179616: Rescheduling not possible without "View all scheduled transitions" permission.
Comment #10
rp7 commentedComment #11
rp7 commentedNow without the same mistake for delete operations as in #3118123: Custom access rules impossible for scheduled transitions.
Comment #13
rp7 commentedThis fixes at least 1 failed assertion. Will need help with the other one (same a in [#3118123).
Comment #14
falc0 commentedUpdated to the latest version (2.2.1).Wrong file, correct one in next comment.
Comment #15
falc0 commentedComment #16
alfattal commented@falc0 Patch in #15 failed to apply.
Comment #17
rp7 commentedFixed patch in #15 so that it applies to 2.3.x
Comment #18
mjmorley commentedAdded a patch here to update the hook update number so it applies to 2.4.x
Comment #19
falc0 commentedHad an error:
Error: Call to undefined method Drupal\node\Entity\Node::isProcessed() in Drupal\scheduled_transitions\ScheduledTransitionsAccessControlHandler->checkAccess() (line 55 of /app/web/modules/contrib/scheduled_transitions/src/ScheduledTransitionsAccessControlHandler.php).Fixed it in the latest patch (see interdiff).