Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
4038
Description
curl -u admin:admin -X POST -H "Content-type: application/json" --data-binary @./grant.json http://localhost:8181/auth/v1/domains/1/users/3/roles
{"message":"Internal error creating grant","details":"SQL Exception : org.h2.jdbc.JdbcSQLException: Parameter \"#2\" is not set; SQL statement:\nSELECT * FROM GRANTS WHERE domainid = ? AND userid = ? AND roleid = ? [90012-185]"}This is caused in DomainHandler.getGrant(int did,int uid,int rid):
PreparedStatement pstmt = conn.prepareStatement("SELECT * FROM GRANTS WHERE domainid = ? AND userid = ? AND roleid = ? ");
pstmt.setInt(1, did);
pstmt.setInt(1, uid);
pstmt.setInt(1, rid);
Should be:
pstmt.setInt(1, did);
pstmt.setInt(2, uid);
pstmt.setInt(3, rid);