@Test public void testReadAllPrivileges() throws SQLException { String user = "user1"; if (userReader.userExist(user)) { SQLUtil.executeUpdateStatement(conn, "drop user \"" + user + "\" cascade"); } SQLUtil.executeUpdateStatement(conn, "create user \"" + user + "\" identified by password"); try { SQLUtil.executeUpdateStatement(conn, "drop table MYTABLE"); } catch (SQLException e) { } SQLUtil.executeUpdateStatement(conn, "create table mytable(id number)"); SQLUtil.executeUpdateStatement(conn, "grant create session to \"" + user + "\""); SQLUtil.executeUpdateStatement(conn, "grant select on mytable to \"" + user + "\""); final List<String> readPrivileges = privReader.readAllPrivileges(user); assertThat(readPrivileges).contains("CREATE SESSION"); assertThat(readPrivileges).contains("SELECT ON " + cfg.getUserOwner() + ".MYTABLE"); SQLUtil.executeUpdateStatement(conn, "drop user \"" + user + "\""); SQLUtil.executeUpdateStatement(conn, "drop table MYTABLE"); }
List<String> readAllPrivileges(String userName) { List<String> privileges = new ArrayList<String>(); privileges.addAll(readSystemPrivileges(userName)); privileges.addAll(readObjectPrivileges(userName)); return privileges; }
OracleRolePrivReader { List<String> readAllPrivileges(String userName) { List<String> privileges = new ArrayList<String>(); privileges.addAll(readSystemPrivileges(userName)); privileges.addAll(readObjectPrivileges(userName)); return privileges; } }
OracleRolePrivReader { List<String> readAllPrivileges(String userName) { List<String> privileges = new ArrayList<String>(); privileges.addAll(readSystemPrivileges(userName)); privileges.addAll(readObjectPrivileges(userName)); return privileges; } OracleRolePrivReader(Connection conn); }
OracleRolePrivReader { List<String> readAllPrivileges(String userName) { List<String> privileges = new ArrayList<String>(); privileges.addAll(readSystemPrivileges(userName)); privileges.addAll(readObjectPrivileges(userName)); return privileges; } OracleRolePrivReader(Connection conn);  }
OracleRolePrivReader { List<String> readAllPrivileges(String userName) { List<String> privileges = new ArrayList<String>(); privileges.addAll(readSystemPrivileges(userName)); privileges.addAll(readObjectPrivileges(userName)); return privileges; } OracleRolePrivReader(Connection conn);   }