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

Stop requiring unnecessary aggregation_unit:toplevel_query:toplevel_query permission scopes #5718

Open
jc-harrison opened this issue Dec 22, 2022 · 0 comments
Labels
FlowAPI Issues related to the FlowKit API permissions

Comments

@jc-harrison
Copy link
Member

Following #5163, access to a toplevel_query query at aggregation_unit level with a other_query sub-query requires both aggregation_unit:toplevel_query:other_query and aggregation_unit:toplevel_query:toplevel_query permission scopes.

This means that the aggregation_unit:toplevel_query:toplevel_query scope is always required, but it is possible for FlowAuth users to define a role with aggregation_unit:toplevel_query:other_query but not aggregation_unit:toplevel_query:toplevel_query, which doesn't actually grant permission for any query (but this may not be intuitively clear to the user).

I wonder whether it would be best to only require aggregation_unit:toplevel_query:toplevel_query (in FlowAPI) if there are no sub-queries? (I.e. if a user has the required sub-query scopes, they don't need to also have the additional top-level scope). Effectively this would change the meaning of aggregation_unit:toplevel_query:toplevel_query from "can run a toplevel_query query" to "can run a toplevel_query query with no sub-queries".

An alternative could be to enforce this on the FlowAuth side (i.e. if agg_unit:tl_query:sub_query is selected, automatically add agg_unit:tl_query:tl_query to the role as well). But I think overall it's cleaner to handle this in FlowAPI.

Originally posted by @jc-harrison in #5163 (comment)

@jc-harrison jc-harrison added FlowAPI Issues related to the FlowKit API permissions labels Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FlowAPI Issues related to the FlowKit API permissions
Projects
None yet
Development

No branches or pull requests

1 participant