public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body
Date: Mon, 19 Sep 2016 14:59:46 +0530
Message-ID: <CAM5-9D-aZaX7UbSaObiHhqkXgYNYvU791L_=9FtO-DR2yrQ_kg@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

Please find attached patch with fix:
Minor changes in template file. Checks were missing for creating package
body and drop package body.

Please review.


Thanks,
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM1588.patch (2.9K, 3-RM1588.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
index 757bcef..3eeaf9e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.1_plus/update.sql
@@ -1,7 +1,7 @@
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}

 {% if data %}
-{% if o_data.pkgbodysrc and data.pkgbodysrc == '' %}
+{% if data.pkgheadsrc is defined and data.pkgheadsrc != o_data.pkgheadsrc and o_data.pkgbodysrc != None %}
 DROP PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }};
 {% endif %}
 {% if data.pkgheadsrc %}
@@ -11,15 +11,6 @@ IS
 {{data.pkgheadsrc}}
 END {{ conn|qtIdent(data.name) }};

-CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
-IS
-{% if data.pkgbodysrc %}
-{{data.pkgbodysrc}}
-{% else %}
-{{o_data.pkgbodysrc}}
-{% endif %}
-END {{ conn|qtIdent(data.name) }};
-{% else %}
 {% if data.pkgbodysrc %}

 CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
@@ -27,7 +18,6 @@ IS
 {{data.pkgbodysrc}}
 END {{ conn|qtIdent(data.name) }};
 {% endif %}
-{% endif %}
 {% if data.pkgacl %}
 {% if 'deleted' in data.pkgacl %}
 {% for priv in data.pkgacl.deleted %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
index 757bcef..edcd883 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/templates/package/ppas/9.2_plus/update.sql
@@ -1,7 +1,7 @@
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}

 {% if data %}
-{% if o_data.pkgbodysrc and data.pkgbodysrc == '' %}
+{% if data.pkgheadsrc is defined and data.pkgheadsrc != o_data.pkgheadsrc and o_data.pkgbodysrc != None %}
 DROP PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }};
 {% endif %}
 {% if data.pkgheadsrc %}
@@ -11,15 +11,7 @@ IS
 {{data.pkgheadsrc}}
 END {{ conn|qtIdent(data.name) }};

-CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
-IS
-{% if data.pkgbodysrc %}
-{{data.pkgbodysrc}}
-{% else %}
-{{o_data.pkgbodysrc}}
 {% endif %}
-END {{ conn|qtIdent(data.name) }};
-{% else %}
 {% if data.pkgbodysrc %}

 CREATE OR REPLACE PACKAGE BODY {{ conn|qtIdent(data.schema,data.name) }}
@@ -27,7 +19,6 @@ IS
 {{data.pkgbodysrc}}
 END {{ conn|qtIdent(data.name) }};
 {% endif %}
-{% endif %}
 {% if data.pkgacl %}
 {% if 'deleted' in data.pkgacl %}
 {% for priv in data.pkgacl.deleted %}


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM1588 - User can not change the code of header through right if package created without body
  In-Reply-To: <CAM5-9D-aZaX7UbSaObiHhqkXgYNYvU791L_=9FtO-DR2yrQ_kg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox