[Greater-commits] r243 - trunk/GREAT-ER-DB/impl/postgresql
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 22 15:31:46 CEST 2011
Author: bricks
Date: 2011-06-22 15:31:44 +0200 (Wed, 22 Jun 2011)
New Revision: 243
Modified:
trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Revoke rights for deleted user
Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-22 13:29:34 UTC (rev 242)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-22 13:31:44 UTC (rev 243)
@@ -23655,8 +23655,8 @@
\return DA_SUCCESS \n DA_FAIL
*/
-int gda_get_user (DB_con *db_con,
- char *vp_user_id,
+int gda_get_user (DB_con *db_con,
+ char *vp_user_id,
DA_T_user **vp_user,
DA_T_errinfo *vp_errinfo)
{
@@ -24062,7 +24062,7 @@
/*
* THE FOLLOWING PART IS NOT USED ANYMORE BECAUSE
- * - CREATE SYNONYM...
+ * - CREATE SYNONYM...
* - ALL_OBJECTS TABLE
*
* FURTHER ON THE PHRASE_TAB SHOULDN'T BE USED BY
@@ -24330,8 +24330,8 @@
\return DA_SUCCESS \n DA_FAIL
*/
-int gda_delete_user (DB_con *db_con,
- char *vp_user_id,
+int gda_delete_user (DB_con *db_con,
+ char *vp_user_id,
DA_T_errinfo *vp_errinfo)
{
DA_T_MODULE_NAME v_module = "gda_delete_user";
@@ -24341,11 +24341,11 @@
int v_data_referenced = 0;
EXEC SQL BEGIN DECLARE SECTION;
- /* host variables */
+ /* host variables */
char h_user_id[31];
- /* long h_phrase_grp_id;*/
- /* char h_role_name[256]; */
- /* char h_revoke_statement[300]; */
+ long h_phrase_grp_id;
+ char h_role_name[256];
+ char h_revoke_statement[300];
/* char h_del_syn_statement[100];*/
/* char h_synonym[31];*/
/* used for pre-check */
@@ -24354,10 +24354,9 @@
/* host var. for DB connection */
char h_con_name[ 31];
/* indicator variables */
- /*short int h_ind_user_id;*/
+ short int h_ind_user_id;
+ EXEC SQL END DECLARE SECTION;
- EXEC SQL END DECLARE SECTION;
-
/* ------------------ *
* Start of function
* ------------------ */
@@ -24546,15 +24545,27 @@
errln = 220;
EXEC SQL WHENEVER NOT FOUND GOTO error;
errln = 230;
- EXEC SQL DELETE FROM USER_TAB
+ EXEC SQL DELETE FROM USER_TAB
WHERE USER_ID = :h_user_id;
+ /* revoke greater standard role from user */
+ h_phrase_grp_id = DA_PHRASE_GRP_ID_ROLE;
+ errln = 240;
+ EXEC SQL SELECT VALUE_PT
+ INTO :h_role_name
+ FROM PHRASE_TAB
+ WHERE PHRASE_GRP_ID = :h_phrase_grp_id;
+
+ sprintf (h_revoke_statement, "REVOKE %s FROM %s",
+ h_role_name, h_user_id);
+ errln = 250;
+ EXEC SQL EXECUTE IMMEDIATE :h_revoke_statement;
+
/*
* THE FOLLOWING PART IS NOT USED ANYMORE BECAUSE
* IN POSTGRESQL THERE IS NO
- * - CREATE ROLE ...
- * - CREATE SYNONYM...
+ * - CREATE SYNONYM...
* - ALL_OBJECTS TABLE
*
* FURTHER ON THE PHRASE_TAB SHOULDN'T BE USED BY
@@ -24568,20 +24579,6 @@
* ROLE STATEMENT.
*/
- /* revoke greater standard role from user */
-/* h_phrase_grp_id = DA_PHRASE_GRP_ID_ROLE;
-
- errln = 240;
- EXEC SQL SELECT VALUE_PT
- INTO :h_role_name
- FROM PHRASE_TAB
- WHERE PHRASE_GRP_ID = :h_phrase_grp_id;
-
- sprintf (h_revoke_statement, "REVOKE %s FROM %s",
- h_role_name, h_user_id);
- errln = 250;
- EXEC SQL EXECUTE IMMEDIATE :h_revoke_statement;
-*/
/* delete user's private synonyms */
/* h_phrase_grp_id = DA_PHRASE_GRP_ID_SYN;
More information about the Greater-commits
mailing list