feat: support update/partial_update in SubsidyAccessPolicyViewSet. #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
andparital_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:
Requesting to modify any other field will result in a
ValidationError
.We use the existing
SubsidyAccessPolicyResponseSerialize
r 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.