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

#133 [FEAT]: Answer approval and classroom ownership logic, improved handling of guest users, and general schema and seed fixes #134

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

IosBonaldi
Copy link
Contributor

This pull request includes several changes to the prisma/schema.prisma file and multiple controller files to introduce new user roles, permissions, and application answer approval functionality. The changes are grouped by theme below:

Schema Changes:

  • Added new roles GUEST to UserRole and AUTHENTICATED to VisibilityMode. [1] [2]
  • Added approved field to ApplicationAnswer model with a default value of false.
  • Updated User model to include relations for created classrooms and updated existing classroom relation.
  • Updated Classroom model to include a creator relation and updated existing user relation.
  • Added keepLocation field to Application model.

Controller Changes:

  • Introduced approveApplicationAnswer function in applicationAnswerController.ts to handle approval of application answers.
  • Updated checkAuthorization in applicationAnswerController.ts to include approval checks based on user roles.
  • Included approved field in the fields object and set default approved value in createApplicationAnswer function. [1] [2]
  • Modified getApplicationWithAnswers in applicationController.ts to filter unapproved answers based on user role and institution.
  • Updated checkAuthorization in various controllers to reflect new role permissions and constraints. [1] [2] [3] [4]

These changes enhance the functionality and security of the application by introducing new roles and permissions, as well as enabling the approval process for application answers.

@IosBonaldi IosBonaldi self-assigned this Dec 2, 2024
@IosBonaldi IosBonaldi mentioned this pull request Dec 2, 2024
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]: Additional properties in Protocol, Classroom, and ApplicationAnswer
1 participant