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

Create annotation to validate role and serialize roles #147

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

coutinho21
Copy link
Contributor

Closes #81

Review checklist

  • Properly documents API changes in the corresponding controller test
  • Contains enough appropriate tests
  • Behavior is as expected
  • Clean, well structured code

@coutinho21 coutinho21 marked this pull request as draft April 13, 2023 16:18
@coutinho21 coutinho21 changed the title Create role to validate role and serialize roles Create annotation to validate role and serialize roles Apr 13, 2023
@bdmendes bdmendes force-pushed the feature/serialize-role branch 2 times, most recently from 26fe416 to a949fd7 Compare May 3, 2023 10:42
@bdmendes bdmendes force-pushed the feature/serialize-role branch 4 times, most recently from b03f3ec to ae82402 Compare July 14, 2023 00:10
@bdmendes bdmendes marked this pull request as ready for review July 14, 2023 00:14
@github-actions
Copy link

Check the documentation preview: https://64b094777f7c04596edc78c5--niaefeup-backend-docs.netlify.app

@MRita443 MRita443 self-requested a review August 2, 2023 15:27
Copy link
Member

@BrunoRosendo BrunoRosendo left a comment

Choose a reason for hiding this comment

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

Great job so far! I have some questions and suggestions

@BrunoRosendo
Copy link
Member

I wrote about this feature in https://github.com/NIAEFEUP/website-niaefeup-backend/wiki/Roles-and-Generations#access-control, please update the information once this is finished

@github-actions
Copy link

Check the documentation preview: https://65060abbfbb37b4dc1cf0e8d--niaefeup-backend-docs.netlify.app

@github-actions
Copy link

Check the documentation preview: https://650b0e56a26a060465039aec--niaefeup-backend-docs.netlify.app

Copy link

github-actions bot commented Aug 3, 2024

Check the documentation preview: https://66ae04c443ec4d5daff6f5b5--niaefeup-backend-docs.netlify.app

Copy link

github-actions bot commented Aug 3, 2024

Check the documentation preview: https://66ae0969a22e2a6a3fea5206--niaefeup-backend-docs.netlify.app

@MRita443
Copy link
Collaborator

@BrunoRosendo pls review

Copy link
Member

@BrunoRosendo BrunoRosendo left a comment

Choose a reason for hiding this comment

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

Good job! I just have a small comment.

From now on, we can apply the logic to existent endpoints, instead of using the test endpoint

Comment on lines 44 to 48
return authentication.authorities.any {
val payload = it.toString().split(":")
payload.size == 2 && payload[0].toLong() == activityId && payload[1].split("-").any { p ->
p == permission.trim().uppercase(Locale.getDefault())
}
Copy link
Member

Choose a reason for hiding this comment

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

I understand but I think it could be a bit more readable. Maybe extract some variables?

Copy link

Check the documentation preview: https://66ca4d1fe850fcfa814462fb--niaefeup-backend-docs.netlify.app

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.

roles: Serialize role and create annotation on top of preAuthorize
5 participants