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

Mirror KC behavior for delete-submission permission #2282

Closed
jnm opened this issue May 22, 2019 · 0 comments · Fixed by #2519
Closed

Mirror KC behavior for delete-submission permission #2282

jnm opened this issue May 22, 2019 · 0 comments · Fixed by #2519
Assignees
Labels
Back end enhancement Ideas, improvements and features

Comments

@jnm
Copy link
Member

jnm commented May 22, 2019

In KoBoCAT, if you have permission to edit submissions, you can delete them as well. By contrast, KPI only assigns delete_submissions to the owner, as a calculated permission that is not stored in the database. After completing #2281, we should:

  1. Change the calculation logic to include delete_submissions in the list of permissions for anyone who has change_submissions;
  2. Change the KPI submissions API to check for delete_submissions instead of change_submissions. See here the test that needs to be updated:
    def test_delete_submission_shared_other_write(self):
    self._other_user_login(True)
    self.asset.assign_perm(self.anotheruser, "change_submissions")
    submission = self.submissions[0]
    url = self.asset.deployment.get_submission_detail_url(submission.get("id"))
    response = self.client.delete(url,
    content_type="application/json",
    HTTP_ACCEPT="application/json")
    self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back end enhancement Ideas, improvements and features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants