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

feat: support update/partial_update in SubsidyAccessPolicyViewSet. #220

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

iloveagent57
Copy link
Contributor

ENT-7149

We want to refactor the policy update API endpoint in a way that makes the permission-ing more obvious and clearly defines the signature of the API using distinct request and response serializers.
This PR changes the SubsidyAccessPolicyViewSet to define update() and parital_update() actions.
Note, this viewset is already hooked up to a router at the /api/v1/subsidy-access-policies/ path.

The following fields are allowed to be updated:

  • description
  • catalog_uuid
  • subsidy_uuid
  • access_method
  • per_learner_enrollment_limit
  • per_learner_spend_limit
  • spend_limit

Requesting to modify any other field will result in a ValidationError.
We use the existing SubsidyAccessPolicyResponseSerializer to output the updated policy record.

Permissions: only the system wide roles that ultimately map to the SUBSIDY_ACCESS_POLICY_WRITE_PERMISSION permission are allowed to update policy records.

@iloveagent57 iloveagent57 force-pushed the aed/policy-partial-update branch 2 times, most recently from a35f3d5 to 0c116da Compare July 18, 2023 19:18
Copy link
Contributor

@pwnage101 pwnage101 left a comment

Choose a reason for hiding this comment

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

LGTM besides nits!

@iloveagent57 iloveagent57 force-pushed the aed/policy-partial-update branch 3 times, most recently from b615b38 to 2d39e84 Compare July 20, 2023 18:35
@iloveagent57 iloveagent57 merged commit 47fc825 into main Jul 20, 2023
@iloveagent57 iloveagent57 deleted the aed/policy-partial-update branch July 20, 2023 18:47
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