From c58fda0a70134bde31c712ccd85f9825f088053a Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Thu, 9 Jul 2020 18:04:32 +0530 Subject: [PATCH] Ensure that create RLS Policy menu should not be visible for catalog objects. Fixes #5633 --- docs/en_US/release_notes_4_24.rst | 3 ++- .../row_security_policies/static/js/row_security_policy.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_24.rst b/docs/en_US/release_notes_4_24.rst index 6883676f8..4d98f3e3e 100644 --- a/docs/en_US/release_notes_4_24.rst +++ b/docs/en_US/release_notes_4_24.rst @@ -31,4 +31,5 @@ Bug fixes | `Issue #5621 `_ - Remove extra brackets from reverse engineering SQL of RLS Policy. | `Issue #5629 `_ - Fixed an issue where the user is able to edit properties when some of the collection nodes are selected. | `Issue #5630 `_ - Fixed an issue where installation of pgadmin4 not working on 32-bit Windows. -| `Issue #5631 `_ - Fixed 'cant execute empty query' issue when remove the value of 'USING' or 'WITH CHECK' option of RLS Policy. \ No newline at end of file +| `Issue #5631 `_ - Fixed 'cant execute empty query' issue when remove the value of 'USING' or 'WITH CHECK' option of RLS Policy. +| `Issue #5633 `_ - Ensure that create RLS Policy menu should not be visible for catalog objects. \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.js index 0895c0415..faf9d6636 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.js @@ -222,6 +222,11 @@ define('pgadmin.node.row_security_policy', [ var treeData = this.getTreeNodeHierarchy(item), server = treeData['server']; + // If node is under catalog then do not allow 'create' menu + if (treeData['catalog'] != undefined) + return false; + + // If server is less than 9.5 then do not allow 'create' menu if (server && server.version < 90500) return false;