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.

Command icon 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

istryker created an issue. See original summary.

  • istryker committed 0e8ccd8d on 2.1.x
    Issue #3556767 by istryker: Inject current_user service via dependency...
istryker’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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