keyshade
keyshade copied to clipboard
refactor(api): Change Authority to Authorities[] in checkAuthorityOverWorkspace
User description
Description
Changed the authority check from a single Authority
to an array of Authorities[]
in the checkAuthorityOverWorkspace
method. This allows for more flexible permission checks where a user can have multiple authorities.
Fixes #196
Dependencies
No new dependencies were added.
Future Improvements
- Consider implementing a more granular authority system if needed in the future.
- Potentially add a caching mechanism for frequently checked authorities to improve performance.
Mentions
@[relevant-team-member] @[project-manager]
Screenshots of relevant screens
N/A - This change is backend-only and does not affect the UI.
Developer's checklist
- [x] My PR follows the style guidelines of this project
- [x] I have performed a self-check on my work
If changes are made in the code:
- [x] I have followed the coding guidelines
- [x] My changes in code generate no new warnings
- [ ] My changes are breaking another fix/feature of the project
- [x] I have added test cases to show that my feature works
- [ ] I have added relevant screenshots in my PR
- [ ] There are no UI/UX issues
Documentation Update
- [x] This PR requires an update to the documentation at docs.keyshade.xyz
- [ ] I have made the necessary updates to the documentation, or no documentation changes are required.
Note: Please review and update the documentation to reflect the change from Authority
to Authorities[]
.
PR Type
Enhancement, Bug fix
Description
- Refactored multiple services to change the authority check from a single
Authority
to an array ofAuthorities[]
. - Updated logic in
AuthorityCheckerService
to handle multiple authorities. - Improved error messages for unauthorized access across various services.
- Ensured all relevant service methods now accept and process an array of authorities.
Changes walkthrough 📝
Relevant files | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Enhancement | 10 files
|
💡 PR-Agent usage: Comment
/help
on the PR to get a list of all available PR-Agent tools and their descriptions