-
Notifications
You must be signed in to change notification settings - Fork 16
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
refactor assessment permissions in django views and API #732
Merged
Conversation
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
shapiromatron
commented
Jan 11, 2023
# Conflicts: # hawc/apps/riskofbias/api.py # hawc/apps/study/views.py
shapiromatron
added a commit
that referenced
this pull request
Apr 7, 2023
shapiromatron
added a commit
that referenced
this pull request
Apr 13, 2023
* prep release * prep for updated client release * update redis * remove copy * add build * add twine * fix manifest * minor updates from release * replace document ready with vanilla js (cherry picked from commit 180a240) * hawcprd -> hawc (cherry picked from commit 728f577) * fix admin export and write test * fix template tag * fix strange apis * remove old endpoint tag list * fix api issues * fix errors w/ invalid user input * fix view error * fix another regression from #732 * add paginator to summary tables list * update full text URL endpoint * word edits * standardize assessment get * get assessment in query_params or body * lint * fix name
shapiromatron
added a commit
that referenced
this pull request
Apr 18, 2023
* upgrade to 3.11 * fix? * fix shape * prep release * prep for updated client release * update redis * remove copy * add build * add twine * fix manifest * minor updates from release * replace document ready with vanilla js (cherry picked from commit 180a240) * hawcprd -> hawc (cherry picked from commit 728f577) * fix admin export and write test * fix template tag * fix strange apis * remove old endpoint tag list * fix api issues * fix errors w/ invalid user input * fix view error * fix another regression from #732 * fix deprecations * remove extra venv * update docs
shapiromatron
added a commit
that referenced
this pull request
Apr 18, 2023
* upgrade to 3.11 * fix? * fix shape * ruff * prep release * prep for updated client release * update redis * remove copy * add build * add twine * fix manifest * minor updates from release * replace document ready with vanilla js (cherry picked from commit 180a240) * hawcprd -> hawc (cherry picked from commit 728f577) * fix admin export and write test * fix template tag * fix strange apis * remove old endpoint tag list * fix api issues * fix errors w/ invalid user input * fix view error * fix another regression from #732 * fix deprecations * remove extra venv * update docs * update versions * black formatting changes * add ruff flake8 + isort ruff config * add pyupgrade to ruff (UP) * black * add RUF linter * add flake8-bugbear * add flake8-bandit * add flake8-print * show fixes when linting * updates w/ new black plugin
shapiromatron
added a commit
that referenced
this pull request
May 8, 2023
* upgrade to 3.11 * fix? * fix shape * ruff * prep release * prep for updated client release * update redis * remove copy * add build * add twine * fix manifest * minor updates from release * replace document ready with vanilla js (cherry picked from commit 180a240) * hawcprd -> hawc (cherry picked from commit 728f577) * fix admin export and write test * fix template tag * fix strange apis * remove old endpoint tag list * fix api issues * fix errors w/ invalid user input * fix view error * fix another regression from #732 * fix deprecations * remove extra venv * update docs * update versions * black formatting changes * add ruff flake8 + isort ruff config * add pyupgrade to ruff (UP) * black * add RUF linter * add flake8-bugbear * add flake8-bandit * add flake8-print * install django 4.2 * git ls-files -- 'hawc/*.py' | xargs django-upgrade --target-version 3.2 * git ls-files -- 'hawc/*.py' | xargs django-upgrade --target-version 4.2 * fix errors from manual testing * add color toggle * revisions from code reviews * layout * updates
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 were currently many patterns for checking permissions to view a page, edit content, or interact with the API. This PR begins consolidating permission checking approaches.
For django based views, whenever we can inherit permissions from an Assessment, we can now inherit from of the common base views in HAWC, instead of adding mixins or custom permission checks. These mixins are now removed:
Renamed this method, it had a misleading name:
Renamed this method in the hawc client, to be consistent with API: