citizenlab
citizenlab copied to clipboard
TAN-852 - Permissions service refactor
A refactor from 2 services with too many methods and mixed focus:
-
PermissionsService-
ParticipationPermissionsService
-
To 4 services - namespaced in Permissions:::
-
PermissionsUpdateService- Dedicated to updating permissions -
UserRequirementsService- Just the logic for return flexible registration requirements -
PermissionsService- All logic for whether access to a resource should be allowed/denied - now with many fewer methods -
ActionDescriptorsService- Generate the action descriptors - instead of doing this in the serializer
Further documentation can be found here - https://www.notion.so/citizenlab/Permissions-service-d0e193dc551949a3bdc60dd0c500d75d
| Warnings | |
|---|---|
| :warning: | The PR title contains no Jira issue key (case-sensitive) |
| :warning: | The branch name contains no Jira issue key (case-sensitive) |
| Messages | |
|---|---|
| :book: | Changelog provided 🎉 |
| :book: | |
| :book: | Check translation progress |
Generated by :no_entry_sign: dangerJS against bc13dbecaba584a2730fcc6f26785bc79f8be24a
@alexander-cit Thoughts on your comments - this is how I might use inheritance which might be clearer:
BasePermissionsService - 2 methods denied_reason_for_action & action_descriptors - all other classes then inherit and extend these methods
-
PhasePermissionsService-
ProjectPermissionsService-
IdeaPermissionsService
-
-
Initiatives would just use BasePermissionsService