} else if(databaseProductType != DatabaseProductType.POSTGRESQL) {\r
throw new Exception("Unrecognized database system " + databaseProductType);\r
} else {\r
- boolean hasRights = false;\r
- // Check for rights on report_common, and infer rights from that\r
- sql = "SELECT has_table_privilege('"+readerRoleName\r
- +"', '"+ReportConstants.DB_COMMON_PART_TABLE_NAME+"', 'SELECT')";\r
- conn = JDBCTools.getConnection(dataSource);\r
- stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery(sql);\r
- if(rs.next()) {\r
- hasRights = rs.getBoolean(1);\r
- }\r
- rs.close();\r
- if(!hasRights) {\r
- sql = "REVOKE SELECT ON ALL TABLES IN SCHEMA public FROM "+readerRoleName;\r
+ sql = "REVOKE SELECT ON ALL TABLES IN SCHEMA public FROM "+readerRoleName;\r
stmt.execute(sql);\r
- sql = "GRANT SELECT ON ALL TABLES IN SCHEMA public TO "+readerRoleName;\r
+ sql = "GRANT SELECT ON ALL TABLES IN SCHEMA public TO "+readerRoleName;\r
stmt.execute(sql);\r
- }\r
}\r
\r
} catch (SQLException sqle) {\r