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

Restrict DROP USER/ROLE from non-dbo user #2879

Conversation

anju15bharti
Copy link
Contributor

Description

Cherry Picked From 2859 and 2863

Earlier, any user was able to drop user/role, irrespective of whether that user has required privileges or not.

With this commit, only dbo should have the permission to drop user/role.

Issues Resolved

BABEL-5173

Test Scenarios Covered

  • Use case based -

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

anju15bharti and others added 2 commits August 26, 2024 06:42
)

Earlier, any user was able to drop user/role, irrespective of whether that user has required privileges or not.

With this commit, Only dbo and members of db_owner will have the permission to drop user/role.  Additionally, this
restricts dropping internal database principal such as dbo and db_owner, it restricts dropping non-Babelfish roles from TDS endpoint.

Task: BABEL-5173

Authored-by: ANJU BHARTI <[email protected]>
Co-authored-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
…stgresql#2863)

Earlier, a user was able to drop user/role that belonged to another database.
With this commit, a user can only drop the role/user that belongs to the same database with sufficient privileges.
Issues Resolved

Task: BABEL-5173

Signed-off-by: Shalini Lohia [email protected]
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 10555173997

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 73.697%

Totals Coverage Status
Change from base Build 10472203668: 0.01%
Covered Lines: 44219
Relevant Lines: 60001

💛 - Coveralls

@shardgupta shardgupta merged commit 4fc9c47 into babelfish-for-postgresql:BABEL_4_3_STABLE Aug 26, 2024
43 checks passed
@shardgupta shardgupta deleted the jira-5173-4_3_stable branch August 26, 2024 11:08
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.

5 participants