#133 [FEAT]: Answer approval and classroom ownership logic, improved handling of guest users, and general schema and seed fixes #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
GUEST
toUserRole
andAUTHENTICATED
toVisibilityMode
. [1] [2]approved
field toApplicationAnswer
model with a default value offalse
.User
model to include relations for created classrooms and updated existing classroom relation.Classroom
model to include a creator relation and updated existing user relation.keepLocation
field toApplication
model.Controller Changes:
approveApplicationAnswer
function inapplicationAnswerController.ts
to handle approval of application answers.checkAuthorization
inapplicationAnswerController.ts
to include approval checks based on user roles.approved
field in thefields
object and set defaultapproved
value increateApplicationAnswer
function. [1] [2]getApplicationWithAnswers
inapplicationController.ts
to filter unapproved answers based on user role and institution.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.