-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(generic): anonymous views #1399
Merged
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
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
from
November 17, 2024 10:55
524cddd
to
1ac5a4a
Compare
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
from
December 17, 2024 10:01
1ac5a4a
to
bdf6288
Compare
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
5 times, most recently
from
December 17, 2024 10:45
cac6fbb
to
2f970ef
Compare
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
from
December 17, 2024 11:05
2f970ef
to
e2a2770
Compare
gythaogg
changed the title
fix(generic): respect APIS_DETAIL_VIEWS_ALLOWED setting
feat(generic): anonymous views
Dec 17, 2024
This was
linked to
issues
Dec 17, 2024
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
2 times, most recently
from
December 17, 2024 12:01
5e083d8
to
e49a0a1
Compare
b1rger
requested changes
Dec 17, 2024
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.
could you move the docs changes into a separate docs(configuration):
commit?
BREAKING CHANGE: APIS_LIST_VIEWS_ALLOWED and APIS_DETAIL_VIEWS_ALLOWED are replaced with a single setting APIS_ANON_VIEWS_ALLOWED When APIS_ANON_VIEWS_ALLOWED is set to True List views and Detail views will be open to anyone, without having to login. APIS_LIST_VIEW_OBJECT_FILTER and APIS_VIEW_PASSES_TEST are no longer supported. Custom managers should be used instead. fixes #1400
gythaogg
force-pushed
the
gythaogg/detail-view-permissions
branch
from
December 18, 2024 08:54
e49a0a1
to
e4122b5
Compare
add documentation for APIS_ANON_VIEWS_ALLOWED remove the following unsupported configurations from the docs - APIS_LIST_VIEWS_ALLOWED - APIS_DETAIL_VIEWS_ALLOWED - APIS_VIEW_PASSES_TEST - APIS_LIST_VIEW_OBJECT_FILTER
b1rger
force-pushed
the
gythaogg/detail-view-permissions
branch
from
December 18, 2024 09:27
e4122b5
to
502c1b6
Compare
b1rger
approved these changes
Dec 18, 2024
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.
This pull request focuses on simplifying the codebase by removing the
ListViewObjectFilterMixin
class and updating related view permissions and settings accordingly. The most important changes include the removal of the mixin class, updates to view permission checks, and corresponding documentation updates.Codebase simplification:
apis_core/core/mixins.py
: Removed theListViewObjectFilterMixin
class and its methods, which were used for filtering querysets and handling permissions in list views.apis_core/generic/views.py
: Removed the import ofListViewObjectFilterMixin
and its usage in theList
class. Updated theget_permission_required
method to check forAPIS_ANON_VIEWS_ALLOWED
instead ofAPIS_VIEW_PASSES_TEST
. [1] [2] [3]Documentation updates:
docs/source/configuration.rst
: Updated the configuration documentation to reflect the the use ofAPIS_LIST_VIEWS_ALLOWED
and removedAPIS_DETAIL_VIEWS_ALLOWED
toAPIS_ANON_VIEWS_ALLOWED
.APIS_LIST_VIEW_OBJECT_FILTER
andAPIS_VIEW_PASSES_TEST
are removed.Sample_Project test example - list only Persons with forename containing "a" for anonymous users
settings.py
APIS_ANON_VIEWS_ALLOWED = True
models.py