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

Recursive permission scheme cannot be done #170

Open
antoine-gallix opened this issue Feb 19, 2019 · 1 comment
Open

Recursive permission scheme cannot be done #170

antoine-gallix opened this issue Feb 19, 2019 · 1 comment

Comments

@antoine-gallix
Copy link

In the following model, with a tree-structure of nested groups:

# model
Group
    name: String
    parent_group: Group

I would like to implement a permission like "You can edit a group name only if you have manage right on the parent group"

permissions = {
    'manage':'manage',
    'edit':'manage:parent',
}

The following will crash at any attempt to access a resource's needs, when potion will enter an infinite loop of trying to compute the needs mapping of the resource.

When trying to access the mapping of needs, the latter will be evaluated on demand.
When trying to resolve the edit right, it will consult the needs mapping of the parent field, which will trigger the evaluation of the need mapping.
Infinite loop!

@lyschoening
Copy link
Contributor

Recursive permissions are not supported. You may want to use Flask-Principal to resolve these.

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

2 participants