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

Propagate project permissions to all KPI Assets #2336

Merged
merged 6 commits into from
Dec 7, 2022

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Nov 16, 2022

Changes / Features implemented

  • Ensure permissions are created for Owners on KPI published assets
  • Ensure permissions are removed from KPI published assets once a users' role is downgraded/removed
  • Cleanup

Steps taken to verify this change does what is intended

  • QA

Side effects of implementing this change

TODO

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation

Closes #1060

@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch 7 times, most recently from 1a87b55 to 94d3a55 Compare November 21, 2022 13:51
@DavisRayM DavisRayM marked this pull request as ready for review November 25, 2022 11:02
@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch from acdf99f to 3fa3ac7 Compare November 25, 2022 11:03
- Add `retrieve_asset_permissions` & `assign_change_asset_permission`
  utility functions

- Add mechanism to remove permissions from users who no longer have a
  role tied to the project
@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch 2 times, most recently from 6665203 to 80a8a2c Compare November 25, 2022 11:11
@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch from 80a8a2c to c987649 Compare November 25, 2022 11:12
@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch from e009328 to c987649 Compare November 25, 2022 11:22
@DavisRayM DavisRayM force-pushed the formbuilder-permission-propagation branch from c6ba34b to e246be0 Compare November 25, 2022 11:51
@DavisRayM DavisRayM merged commit 8279012 into main Dec 7, 2022
@DavisRayM DavisRayM deleted the formbuilder-permission-propagation branch December 7, 2022 07:23
# Propagate permissions for XForms that were published by
# Formbuilder
for form_id in form_ids:
asset: XForm = XForm.objects.get(id=form_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a try catch block here so that if the xform doesnt exist in replica it can be fetched from master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that might not be something we'd need to handle since this line should only return XForm objects that are available in the moment

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.

Form builder forms can not be edited by other admins in org account
3 participants