Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drush entity:delete only takes into account entities which the anonymous user can access #5058

Closed
codebymikey opened this issue Jan 31, 2022 · 2 comments

Comments

@codebymikey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Running a command such as:

drush entity:delete node

Will only take into account nodes which are published (or can be accessed by anonymous users).

Describe the solution you'd like
The query object retrieved by the command should invoke $query->accessCheck(FALSE); so that the entity access check is ignored.

The main question is whether this should be introduced as a new no-access-check option or be the default behaviour going forward (and allowing users to opt out to keep the old behaviour).

@weitzman
Copy link
Member

IMO this is a bug and we dont need to keep old behavior. Any objections?

@codebymikey
Copy link
Contributor Author

No objections on my end!

ndf added a commit to ndf/drush that referenced this issue Feb 2, 2022
* 11.x: (125 commits)
  Add a default value for the field widget choice in field:create (drush-ops#5060)
  Fix drush-ops#5058. Load/delete entities that are access controlled. (drush-ops#5059)
  Ignore services on invalid reference (drush-ops#5056)
  Fix tests on Drupal 10 (drush-ops#5054)
  Fix usage example in core:route command (drush-ops#5053)
  Back to dev.
  Prep for 11.0.4
  Update SecurityUpdateCommands endpoint (drush-ops#5043)
  Remove drush_get_global_options() (drush-ops#5046)
  Remove unused global options remote-host and remote-user. (drush-ops#5045)
  sql:sync minor cleanup (drush-ops#5044)
  Add back semver_example test on highest. (drush-ops#5031)
  Return values instead of keys in discoverCommandsFromConfiguration. (drush-ops#5039)
  Back to dev.
  Prep for 11.0.3
  Dont define entity-updates (drush-ops#5038)
  Back to dev.
  Prep for 11.0.2
  Remove dead code and re-enbale --partial test. (drush-ops#5036)
  Bump site-process for less verbose exceptions. (drush-ops#5034)
  ...

Merge conflicts
- src/Drupal/Commands/core/drush.services.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants