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

#137 [FEAT]: Permission management optimizations #138

Merged
merged 14 commits into from
Feb 23, 2025

Conversation

IosBonaldi
Copy link
Contributor

This pull request includes several changes to the prisma/schema.prisma file and the src/controllers/applicationAnswerController.ts file to add new features and improve functionality. The most important changes include adding new user roles and visibility modes, updating the ApplicationAnswer model, introducing a new Coordinate model, and enhancing the application answer controller with additional roles and actions.

Schema updates:

  • Added GUEST to UserRole enum and AUTHENTICATED to VisibilityMode enum in prisma/schema.prisma. [1] [2]
  • Updated ApplicationAnswer model to include approved field and replaced address relation with coordinate relation.
  • Introduced a new Coordinate model to store latitude and longitude information.

Controller enhancements:

  • Added functions getApplicationUserRoles, getApplicationAnswerUserRoles, and getApplicationAnswerActions to manage user roles and actions for application answers in src/controllers/applicationAnswerController.ts. [1] [2]
  • Updated checkAuthorization function to use new role-checking functions and added support for approve action.
  • Modified createApplicationAnswer and updateApplicationAnswer functions to handle coordinate data and filter sensitive fields from the response. [1] [2] [3] [4] [5]

@IosBonaldi IosBonaldi self-assigned this Jan 23, 2025
@IosBonaldi IosBonaldi linked an issue Jan 23, 2025 that may be closed by this pull request
@IosBonaldi IosBonaldi force-pushed the 137-feat-permission-management-optimizations branch from c36c795 to 45900d7 Compare January 27, 2025 18:06
Copy link
Contributor

@YuriTobias YuriTobias left a comment

Choose a reason for hiding this comment

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

Ótimo! Muitas alterações vindas da #134 e #136!

@IosBonaldi IosBonaldi merged commit 48c1742 into main Feb 23, 2025
@IosBonaldi IosBonaldi deleted the 137-feat-permission-management-optimizations branch February 23, 2025 21:52
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.

[FEAT]: Permission management optimizations
2 participants