Skip to content

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

Description

@mahenzon

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthacktoberfestinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions