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

✨ Support EXECUTE statements - with permissions #951

Closed
joocer opened this issue Mar 23, 2023 · 1 comment
Closed

✨ Support EXECUTE statements - with permissions #951

joocer opened this issue Mar 23, 2023 · 1 comment

Comments

@joocer
Copy link
Contributor

joocer commented Mar 23, 2023

EXECUTE <function>[(<param>[, param,...])]

Tactical solution - Save the SQL for the query in a local file, use the existing parameterization functionality to insert parameters.

Need to find a way to limit some users to only EXECUTE functions - i.e. cannot run arbitrary SQL, can only run prepared statements.

@joocer
Copy link
Contributor Author

joocer commented Mar 23, 2023

something like

opteryx.connection(permissions=opteryx.permissions)

RBACed applications can then do something like

roles_permissions = {
    "admin": opteryx.permissions,
    "user": {"Execute"}
}

permissions = set()
for role in user_roles:
    if role in roles_permissions:
        permissions |= roles_permissions[role]
return permissions

@joocer joocer closed this as completed Mar 24, 2023
joocer added a commit that referenced this issue Mar 24, 2023
joocer added a commit that referenced this issue Mar 24, 2023
joocer added a commit that referenced this issue Mar 24, 2023
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

1 participant