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

Restrict anonymous submission migration to surveys #4840

Conversation

jnm
Copy link
Member

@jnm jnm commented Feb 9, 2024

Notes

Asset types other than survey should not be assigned add_submissions; we thought it was benign, but it can cause problems when:

  1. The back end includes this in the list of permissions assignments served to the front end for some non-survey library item
  2. The front end sends the (possibly modified) assignments back in bulk, including the extraneous add_submission assignment
  3. The back end rejects the front end's request because add_submission is not a valid assignment for the asset type

Internal discussion: https://chat.kobotoolbox.org/#narrow/stream/4-Kobo-Dev/topic/can't.20share.20collections.20in.20library/near/337874

Description

Avoids future "Failed to update permissions" errors when trying to change sharing settings for library items

Related issues

Related to #4719

Asset types other than `survey` should not be assigned
`add_submissions`; we thought it was benign, but it can cause problems
when:
1. The back end includes this in the list of permissions assignments
   served to the front end for some non-`survey` library item
2. The front end sends the (possibly modified) assignments back in bulk,
   including the extraneous `add_submission` assignment
3. The back end rejects the front end's request because `add_submission`
   is not a valid assignment for the asset type
@noliveleger noliveleger merged commit e2201da into release/2.024.04 Feb 9, 2024
4 checks passed
@noliveleger noliveleger deleted the restrict-anonymous-submission-migration-to-surveys branch February 9, 2024 14:28
@noliveleger
Copy link
Contributor

We should add a note to release notes to self-hosters how to remove the permissions on other asset types.

@jnm
Copy link
Member Author

jnm commented Feb 9, 2024

Let's go one further and make another migration that removes them. I'll open a PR for that

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.

2 participants