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

POST permission requires GET permission to be present, otherwise it doesn't work #20

Open
mahenzon opened this issue Oct 23, 2020 · 0 comments
Labels
bug Something isn't working enhancement New feature or request hacktoberfest invalid This doesn't seem right

Comments

@mahenzon
Copy link
Contributor

If you define List resource like this:

class PersonList(ResourceList):
    schema = schemas.PersonSchema
    methods = ["POST"]
    data_layer = {
        "session": db.session,
        "model": models.Person,
        "permission_post": [permissions.PersonPermission],
    }

POST permission doesn't work 😨 . You can create objects without any permissions

but if you add GET permission

class PersonList(ResourceList):
    schema = schemas.PersonSchema
    methods = ["POST"]
    data_layer = {
        "session": db.session,
        "model": models.Person,
        "permission_get": [permissions.PersonPermission],
        "permission_post": [permissions.PersonPermission],
    }

then it works. before creating it checks get permission

@mahenzon mahenzon added bug Something isn't working enhancement New feature or request invalid This doesn't seem right hacktoberfest labels Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hacktoberfest invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant