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

Add filter to bypass the Delete/Update Term permission check in SyncManager #2020

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

kallehauge
Copy link
Contributor

@kallehauge kallehauge commented Jan 8, 2021

Description of the Change

This change will add a hook to override the permission check when deleting/updating terms. This feature already exists in the Post SyncManager when deleting and updating.

Alternate Designs

This code will mirror how it's currently done in the Post SyncManager but the code could be expanded to include the DOING_CRON conditions in the delete action for both term and post so the logic is more similar. It could be argued to be outside this scope since the current/initial PR suggestion will simply add opt-in features whereas adding CRON conditions changes default behavior.

Benefits

Allows developers to bypass the user permission check for operations that happens outside logged in environments (CLI etc).

Possible Drawbacks

Could allow for developers to create their own "vulnerability" so others can delete/updating terms without user permission but is not inherently true by default. I'm guessing this is not something you're too worried about (like me) since it already exists in the Post SyncManager.

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Changelog Entry

Added filter to bypass user permission check before deleting/updating terms from index.

@kallehauge kallehauge changed the title Add filter to bypass the Delete Term permission check Add filter to bypass the Delete/Update Term permission check in SyncManager Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant