Skip to content

Conversation

@Sanket-Shelar
Copy link
Contributor

…ge when attempting to GRANT privilege on a database

What changes were proposed in this pull request?

Updated ensureAdminAccess() method to get user from session and if session is null get user from grantor passed.

How was this patch tested?

Build successful, tested for grant scenarios and working.

…ge when attempting to GRANT privilege on a database
final boolean isKeyAdmin;

if (StringUtils.isEmpty(grantor)) {
if (StringUtils.isNotEmpty(bizUtil.getCurrentUserLoginId())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated code changes the precedence of user selection. Originally, it prioritized the granter as the admin user, but now it favors the login user. Was this change intentional?
Also, the else block doesn't check if granter is null or empty. Please add this check for consistency.

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.

2 participants