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

Role management endpoints #145

Merged
merged 27 commits into from
Aug 16, 2023
Merged

Role management endpoints #145

merged 27 commits into from
Aug 16, 2023

Conversation

LuisDuarte1
Copy link
Member

Closes #79

Adds various endpoints for role management, such as:

  • Add/remove roles
  • Gets all roles
  • Get a specific role
  • Add/remove users from a role
  • Grant/Revoke permissions from a role
  • Add/remove activities that are associated with a role
  • Add/remove permissions on PerActivityRoles

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Check the documentation preview: https://642d8b5ae9a57b4c25c78bd5--niaefeup-backend-docs.netlify.app

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Patch coverage: 90.52% and project coverage change: +2.33 🎉

Comparison is base (0a5b495) 88.49% compared to head (a17fe90) 90.82%.

❗ Current head a17fe90 differs from pull request most recent head 09ee6c4. Consider uploading reports for the commit 09ee6c4 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #145      +/-   ##
=============================================
+ Coverage      88.49%   90.82%   +2.33%     
- Complexity       345      393      +48     
=============================================
  Files             61       65       +4     
  Lines            791      916     +125     
  Branches          65       75      +10     
=============================================
+ Hits             700      832     +132     
+ Misses            57       40      -17     
- Partials          34       44      +10     
Impacted Files Coverage Δ
.../up/fe/ni/website/backend/service/ErrorMessages.kt 85.71% <33.33%> (-5.20%) ⬇️
...pt/up/fe/ni/website/backend/service/RoleService.kt 86.58% <89.23%> (+69.19%) ⬆️
...fe/ni/website/backend/controller/RoleController.kt 100.00% <100.00%> (ø)
.../website/backend/dto/permissions/PermissionsDto.kt 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Check the documentation preview: https://642d8bdd7b8e354bb1f7061d--niaefeup-backend-docs.netlify.app

@BrunoRosendo BrunoRosendo requested review from a team and removed request for a team April 5, 2023 15:29
@BrunoRosendo
Copy link
Member

Is it ready for review?

@github-actions
Copy link

Check the documentation preview: https://64494031ea2fff069ea42bf3--niaefeup-backend-docs.netlify.app

@BrunoRosendo BrunoRosendo self-requested a review May 3, 2023 15:37
@LuisDuarte1 LuisDuarte1 requested review from limwa, bdmendes and MRita443 May 3, 2023 15:38
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 so far! I know I wrote a lot of comments but the functionalities are there and seem to work as expected! A lot of the comments are about small things like documentation and code suggestions

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

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

@BrunoRosendo BrunoRosendo linked an issue Jul 19, 2023 that may be closed by this pull request
Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

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

Almost there! I just marked some comments that haven't been properly dealt with and one other suggestions!

@BrunoRosendo
Copy link
Member

Please change this in the generation service too:

private fun assignRolesAndActivities(generation: Generation, dto: GenerationDto) {

I commented the lines where I defined both sides of the relationship

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.

I just noticed we don't have a way of updating some role fields, such as name and isSection. We can discuss that in the next meeting

Tag.ROLES,
mutableListOf(
DocumentedJSONField("name", "Name of the role", JsonFieldType.STRING),
DocumentedJSONField("permissions", "Permissions in the role, as an integer", JsonFieldType.ARRAY),
Copy link
Member

Choose a reason for hiding this comment

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

You may want to open an issue for that and CC him

Comment on lines 78 to 79
role.generation = generation
generation.roles.add(role)
Copy link
Member

Choose a reason for hiding this comment

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

Only the generation side is necessary

Copy link
Member Author

Choose a reason for hiding this comment

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

without the generation side it doesn't work for some reason :/

@github-actions
Copy link

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

Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@BrunoRosendo
Copy link
Member

I just noticed we don't have a way of updating some role fields, such as name and isSection. We can discuss that in the next meeting

@LuisDuarte1 I only want to discuss this in a meeting, I forgot last time

@github-actions
Copy link

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

@LuisDuarte1
Copy link
Member Author

LuisDuarte1 commented Aug 16, 2023

I just noticed we don't have a way of updating some role fields, such as name and isSection.

Done

@github-actions
Copy link

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

@LuisDuarte1 LuisDuarte1 merged commit 4d457a4 into develop Aug 16, 2023
@LuisDuarte1 LuisDuarte1 deleted the feature/roles branch August 16, 2023 15:27
@github-actions
Copy link

Check the documentation preview:

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: Create endpoints for role management projects: add roles across team members
5 participants