forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Database owner login is unable to view db objects in SSMS
Currently in babelfish when we create a login (e.g. postjend_svc) and a database (e.g. test) and make postjend_svc owner of test and then connect to SSMS object explorer as login "postjend_svc" to database "test" and try to expand the "Database" field to view the objects. It does not show anything. With this change the login with be able to expand the "Database" field. The issue arrised because when the databases are expanded in SSMS, a query is being executed which contains a cross-db query. Currently, we handle cross-db queries by switching the database and current user. This cross-db query is resulting into permission denied error due to lack of permission of the current user (which is switched internally to master_guest) to insert into a table created in "test" db. The solution of the above issue is implemented in two parts: 1 - For the successful execution of the cross-db query, I switched the current user with session user (login) which resulted in the user having adequate permission of both the databases required for the execution of the script. BABEL-5218 was found after implementing the above fix. This issue arrised because when a non sysadmin login tries to run cross-db dml query like INSERT. The permission check is done through the pg_catalogue side causing a permission denied error because dbo role for that database is not given to that login during the "alter authorization". 2 - To fix the above issue, I assigned dbo role to the login when it is made the owner of the database. Since the login has the dbo role, it can perform the above queries successfully. Task: BABEL-5119, BABEL-5218 Signed-off-by: P Aswini Kumar <[email protected]>
- Loading branch information
P Aswini Kumar
committed
Aug 29, 2024
1 parent
2aa4924
commit 7e60aba
Showing
6 changed files
with
196 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters