This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
I24 permission protection + metadata on course-evaluation page #113
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
525230b
ADDED comment and better interface display on names
frinzekt c00096a
ADDED user service method permission protection
frinzekt 13add9d
IMPROVED filter-based-permission to also block GET methods
frinzekt 8a03ce4
ADDED coordinators and reviewers as meta information to course-evalua…
frinzekt 64a9159
ADDED role-based restrictions to course-evaluation and reviews
frinzekt d515c93
FIXED where string courseId cannot find in the Array of Object courseId
frinzekt c3dab09
evaluationList remove user service as a dependence
frinzekt 7bd6877
Merge remote-tracking branch 'origin/develop' into i24-permission-pro…
frinzekt 2eada08
remove dependence of the other information component to user service
frinzekt 806ab62
remove dependency of reviewProgress component in users service
frinzekt b744c17
disable view if reviewer hasnt started on review
frinzekt 545b26b
remove dependency of compiled report component from user service
frinzekt 9a6d0c3
remove dependence of ManageReviewers with course-evaluation
frinzekt a03e976
fixed bug where the interface is just showing [object.object] in coor…
frinzekt c49e7b0
fix bug where reviewer cannot update review
frinzekt 4d5ba77
linting of console log
frinzekt 570f703
documentation for permission and service metadata
frinzekt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Permission | ||
Permission refers to the authority of the user to access or modify information. In business rules, the only reason why a user has to have permission if they need to have access to that information or authority to have action. This means that if a user does not need to access that information, they should not have it. | ||
|
||
In IndEAA, this is essential in restricting each of the users to perform only actions that they have permission over. The permission has 2 main elements: | ||
|
||
- `role` (what sets of permission does the user have?) | ||
- `course_id` (which `course_evaluation` where this role persists?) | ||
|
||
|
||
## Relationship to Frontend | ||
Although this part of the documentation applies for both the backend and frontend, this documentation is mainly for backend as it is where most business rules will apply. Permissions for frontend mainly apply only for the convenience of the user, but does not protect certain information or action from being exposed. Hence, all data-driven action (CRUD operations) should be protected by the backend. | ||
|
||
## Role | ||
|
||
### Administrator | ||
Administrators have the capability to adjust all the permissions of the user in the system, and even has the ability to delete users from the system. | ||
|
||
### Coordinator | ||
Coordinators have the capability adjust everything related to the `course_evaluation` and should be able to view details about other coordinators and reviewers of their `course_evaluation` | ||
|
||
### Reviewer | ||
|
||
Reviewers have the capability to adjust everything related to their own `review` for a `course_evaluation`, and should be able to view details about coordinators for the `course_evaluation` they are assigned to. | ||
|
||
## Hooks | ||
|
||
### Role-Based Restriction | ||
This hook restricts actions/service methods only to users with a specific role regardless of `course_id`. | ||
|
||
???+ example "Examples of Times where you want this" | ||
|
||
- Admiinistrator Role | ||
|
||
The administrator role does not need `course_id`. Hence, should be used for it | ||
|
||
- Coordinator Role | ||
|
||
Creating a `course_evaluation` requires a Coordinator role, but does not need to check for `course_id` | ||
|
||
### Filter-Based Restriction | ||
This hook restricts query (`GET` and `FIND` service methods) to limit (`FIND`) based on query or restricts access (`GET`). | ||
|
||
### Role-And-Course Based Restriction | ||
This hook is a stricter version of `Role-Based Restrictions` as this also applies with `course_id` that the user has access to. | ||
|
||
???+ example "Example of Times where you want this" | ||
|
||
- Multi-Role Coordinator | ||
|
||
A coordinator should not have access to other `course_evaluation` they do not have access on. | ||
|
||
- Multi-Role Reviewer | ||
|
||
A reviewer should not have access to `course_evaluation` they do not have access on, and should also not be able to view `review` that they are not the review person for. | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working