-
Story
-
Resolution: Unresolved
-
Normal
-
None
UPDATE role
Should implement the API as specified in the spec
Implementation notes (use as guidelines and reach out to sgunta@redhat.com if you run into issues implementing):
View:
- should update http_method_names in the view, to include PUT
- Add a separate method for update in the view (similar to create)
Serializer
- Reuse the RoleV2RequestSerializer and RoleV2ResponseSerializer, since the request and response should be pretty similar
- Keep this layer as minimal as possible, avoid adding any validations
Service
- Add new method for update
- It should be enclosed in the @atomic decorator
- You should look up an existing role and throw an exception if it does not exist. A new exception may need to be added here.
- Refactor common code from create and reuse here as much as possible
- Replication should happen successfully, so write needs to be made to outbox
Acceptance Criteria:
- API spec should take implementation into consideration
- API should be consistent with other RBAC V2 APIs
- Shared in the team-mgmt-fabric channel and reviewed by architects and leads
- Have to consider this: https://issues.redhat.com/browse/RHCLOUD-37863
- For implementing Serializable isolation, we introduced an @atomic decorator and a mixin to apply this across all APIs in a given namespace
- Use the same pattern. The mixin may need to be updated to work for batch delete method
- Something to note is that the decorator for an atomic transaction should be in the service layer method as well as the view.
- Should follow hexagonal architecture principles. The attached diagram is a good reference of how to organize concerns between layers. Please use the CreateRole PR as a reference.
- Tests should be implemented for each layer
- is cloned by
-
RHCLOUD-45193 Fix broken replication for Create Role
-
- Release Pending
-