-
Notifications
You must be signed in to change notification settings - Fork 5
Permissions based on job type #891
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
9c8a432
Moved permission checks to the BaseModel class
mohamedelabbas1996 4fdae24
Refactor Job model permission checks to include job type for finer-gr…
mohamedelabbas1996 c43ef9c
Added fine-grained permissions for each job type
mohamedelabbas1996 4407af1
Modified roles to use the fine-grained job permissions
mohamedelabbas1996 1ec1595
Updated views to use the new permission checks
mohamedelabbas1996 c4de3de
Removed old job permissions from tests
mohamedelabbas1996 43d7bbf
Added migration file
mohamedelabbas1996 35a6ea8
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 b4ef1bc
Added permission for processing single source image
mohamedelabbas1996 a83e919
Merge branch 'feat/restrict-ml-processing-jobs' of https://github.com…
mohamedelabbas1996 095b899
Changed PermissionError to PermissionDenied
mohamedelabbas1996 c694706
Added migration file
mohamedelabbas1996 5515a87
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 3fc6906
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 5123aef
tests: Added tests for fine-grained job run permission
mohamedelabbas1996 805f87b
Move process single source image permission from source image to job …
mohamedelabbas1996 e995d9d
Added migration files
mohamedelabbas1996 cdbae94
Remove process_sourceimage permission from job details response
mohamedelabbas1996 22882a6
Added type hints
mohamedelabbas1996 a7eab7a
Modified process single image permission name
mohamedelabbas1996 4ee7e53
Added migration file
mohamedelabbas1996 7adf27d
Changed tests to check for run single image permission in the job det…
mohamedelabbas1996 9642ab7
chore: update FE permission handling for processing single captures
annavik b4e16ad
chore: update FE permission handling to use single run permission
annavik f385af3
Squashed migrations
mohamedelabbas1996 a9b39d7
Merge branch 'feat/restrict-ml-processing-jobs' of https://github.com…
mohamedelabbas1996 d166865
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 a15e9cf
Cleaned up permission check classes defined for each model and used a…
mohamedelabbas1996 19deb5f
Cleaned up BaseModel permission checks
mohamedelabbas1996 952e5ff
Returned run_single_image_ml_job permission with the source image object
mohamedelabbas1996 4824df3
Implemented custom permission checks for the identification model to …
mohamedelabbas1996 28c605d
Removed generic job run, cancel and retry permissions
mohamedelabbas1996 1f8b0e2
Revoked ml job run permission
mohamedelabbas1996 737da22
Merge branch 'feat/restrict-ml-processing-jobs' of https://github.com…
mohamedelabbas1996 81fc2a9
Added a migration to delete deprecated job permissions
mohamedelabbas1996 e215ac9
Added tests to make sure that job permissions are returned correctly …
mohamedelabbas1996 6a16ac0
Changed permission name for run single image
mohamedelabbas1996 4e045e5
Added tests for single image ml job
mohamedelabbas1996 38b7fdf
Delete migration file
mohamedelabbas1996 d7028e7
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 2f87531
Fixed conflicting migrations issue
mohamedelabbas1996 b37b43b
Merge branch 'main' of github.com:RolnickLab/antenna into feat/restri…
mihow dd35803
chore: resolve migration conflicts
mihow c956ffa
Use logger.info instead of print in migration for deleting deprecated…
mohamedelabbas1996 b388931
Merge branch 'main' into feat/restrict-ml-processing-jobs
mohamedelabbas1996 1d18e31
Merged migrations
mohamedelabbas1996 003e7e6
Granted basic members create_job permission
mohamedelabbas1996 1fd3f5d
Modified tests to allow basic members to create a job
mohamedelabbas1996 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Would it work to default this to False?
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.
here if has permission returns False it will just deny access and won't even check object level permissions.
This is because has_permission() is evaluated first for view-level access, and only if it passes does DRF proceed to check object-level permissions (if applicable). So even if has_object_permission() would allow the action, it won’t matter if has_permission() blocks the request upfront.