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

Short-circuit the actor stack when the user can't edit works #3845

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

no-reply
Copy link
Contributor

In the case that a request to the actor stack tries to add a work to a parent
that the current ability cannot edit, we want to avoid doing so.

Previously, we allowed the stack to carry on creating the new work, only to fail
at the end--with an incomplete work. This leaves the application data in an
undesirable state.

Here, we eagerly fail by checking the permissions of the target works before
continuing with the stack. If we don't have the correct permissions, we avoid
creating any works.

@samvera/hyrax-code-reviewers

In the case that a request to the actor stack tries to add a work to a parent
that the current ability cannot edit, we want to avoid doing so.

Previously, we allowed the stack to carry on creating the new work, only to fail
at the end--with an incomplete work. This leaves the application data in an
undesirable state.

Here, we eagerly fail by checking the permissions of the target works before
continuing with the stack. If we don't have the correct permissions, we avoid
creating any works.
@no-reply
Copy link
Contributor Author

this would benefit from a backport to 2.1.x

@laritakr laritakr merged commit 1084cc3 into master Jun 24, 2019
@laritakr laritakr deleted the actor-add-to-work branch June 24, 2019 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants