Problem/Motivation
DraggableViews plugins currently do not consistently inject or use the current user context for permission checks (e.g., 'access draggableviews'). This can lead to unreliable permission handling and makes the code less robust and harder to maintain.
Steps to reproduce
1. Use DraggableViews in a scenario where permission checks depend on the current user.
2. Notice that permission logic may not work as expected, especially in custom or edge-case contexts.
Proposed resolution
- Refactor DraggableViews plugins to inject the current user service via the container.
- Add a setCurrentUser() method to store the user context in the plugin.
- Use the injected user object for all permission checks within the plugin.
Remaining tasks
- Update plugin constructors and factories to inject the current user.
- Refactor permission checks to use the injected user object.
- Test permission logic in various scenarios.
User interface changes
None.
API changes
- Plugins will have a setCurrentUser() method and expect the current user to be injected.
Data model changes
None.
Issue fork draggableviews-3556767
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
istryker commented