Fixed an issue where non-super PostgreSQL users are not able to terminate their own connections from dashboard. #6836

pull/6853/head
Aditya Toshniwal 2023-10-11 13:43:31 +05:30
parent 2b8efc6361
commit e22492ad51
3 changed files with 5 additions and 1 deletions

View File

@ -43,3 +43,4 @@ Bug fixes
| `Issue #6718 <https://github.com/pgadmin-org/pgadmin4/issues/6718>`_ - Pin the cryptography version to fix PyO3 modules initialisation error.
| `Issue #6790 <https://github.com/pgadmin-org/pgadmin4/issues/6790>`_ - Ensure that the backup works properly for PG 16 on the latest docker image.
| `Issue #6799 <https://github.com/pgadmin-org/pgadmin4/issues/6799>`_ - Fixed an issue where the user is unable to select objects on the backup dialog due to tree flickering.
| `Issue #6836 <https://github.com/pgadmin-org/pgadmin4/issues/6836>`_ - Fixed an issue where non-super PostgreSQL users are not able to terminate their own connections from dashboard.

View File

@ -739,7 +739,7 @@ export default function Dashboard({
} else if (is_super_user) {
// Super user can do anything
return true;
} else if (current_user && current_user == treeNodeInfo.server.user) {
} else if (current_user && current_user == treeNodeInfo.server.user?.name) {
// Non-super user can cancel only their active queries
return true;
} else {

View File

@ -192,7 +192,10 @@ export default function FormView({
depListener.addDepListener(accessPath.concat(field.id), accessPath.concat(field.id), field.depChange, field.deferredDepChange);
}
(evalFunc(null, field.deps) || []).forEach((dep)=>{
// when dep is a string then prepend the complete accessPath
let source = accessPath.concat(dep);
// but when dep is an array, then the intention is to provide the exact accesspath
if(_.isArray(dep)) {
source = dep;
}