Skip to content
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

403 on getting list of pages #76

Open
mirzadelic opened this issue Apr 9, 2021 · 5 comments
Open

403 on getting list of pages #76

mirzadelic opened this issue Apr 9, 2021 · 5 comments

Comments

@mirzadelic
Copy link

I tied with steps on docs but couldn't get list of pages, always getting 403 error.

Problem was that I have:

REST_FRAMEWORK = {
    "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",)
}

This is actually a problem, when I remove the default permission class it works. But I think this is not good.

permission_classes on this specific view in the wagtail-transfer project can be [] and it will be solved.

Or is there any other solution that can fix this?

Thanks.

@leongraumans
Copy link

@mirzadelic did you find any other solution by now? :) I'm running into the same problem.

@mirzadelic
Copy link
Author

mirzadelic commented Feb 10, 2022

@leongraumans I used custom permission with rest framework:

common/permissions.py:

class WagtailTransferOrIsAuthenticated(IsAuthenticated):
    """
    Allow access to wagtail_transfer.
    """
    def has_permission(self, request, view):
        if view.__module__.split('.')[0] == 'wagtail_transfer':
            return True
        return super().has_permission(request, view)

And in settings.py:


REST_FRAMEWORK = {
    ...
    "DEFAULT_PERMISSION_CLASSES": (
        "common.permissions.WagtailTransferOrIsAuthenticated",
    ),
    ...

I used this as temporary solution, until I transferred, and then reverted to primary permission classes.

Hope this helps you :)

@klowe0100
Copy link

I was getting a 403 error as well but seems to be unrelated to django rest framewrok. It was related to url encoding of some the query parameters leading to mismatched digests.

Details and PR here: #111

@truthdoug
Copy link

I've had this problem when the two servers were running different versions of wagtail-transfer

@freddiemixell
Copy link

This is still working 2023, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants