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

create data filter parser #97

Merged

Conversation

kbarbounakis
Copy link
Contributor

@kbarbounakis kbarbounakis commented Nov 30, 2022

This PR closes #96 by implementing DataModelPrivilege.scope which may be used to exclude privileges defined for specific client scopes. The meaning of "scope" is included in OAuth2 authorised environments but it can be used by any environment which implements such protocols.
e.g. Order model defines a self privilege for giving access to customers for reading their orders. This privilege may be validated only when context includes orders or orders:readonly scopes.

{
            "mask": 1,
            "type": "self",
            "filter": "customer/user eq me()"
            "scope": [
                   "orders",
                   "orders:readonly"
            ]        
}

@kbarbounakis kbarbounakis merged commit 127c807 into themost-framework:master Dec 1, 2022
@kbarbounakis kbarbounakis deleted the create-filter-parser branch December 1, 2022 10:42
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

Successfully merging this pull request may close these issues.

Define a query for excluding self privileges
1 participant