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

fix(session):If function is custom, executing 'select function' in sql window should need database change permission #4123

Open
wants to merge 9 commits into
base: dev/4.3.x
Choose a base branch
from

Conversation

zijiacj
Copy link
Collaborator

@zijiacj zijiacj commented Jan 6, 2025

What type of PR is this?

type-bug

What this PR does / why we need it:

Currently, executing the select function in sql windows is identified as select type. Only the query permission of the database is required. However, custom functions can change the state of the database, so they should be changed to require change permission of database.
This pr will judge the function contained in the sql statement. If it is a custom function, query and change permission are both required . If it is a system native function, only query is required.
So the approach is this: If the function is a custom function, only need to add SqlType.ALTER to the corresponding set of SqlType, so that the subsequent resource verification logic can be reused.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@zijiacj zijiacj self-assigned this Jan 6, 2025
@zijiacj zijiacj added type-bug Something isn't working and removed type-bug Something isn't working labels Jan 6, 2025
@zijiacj zijiacj modified the milestones: 4.3.x, ODC 4.3.3 Jan 6, 2025
@zijiacj zijiacj added the type-bug Something isn't working label Jan 6, 2025
@zijiacj zijiacj changed the title fix(session):the sql statement of 'select function' should need database change permission fix(session):If function is custom, executing 'select function' in sql window should need database change permission Jan 7, 2025
@zijiacj zijiacj removed the type-bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

2 participants