Uploaded image for project: 'aaa'
  1. aaa
  2. AAA-54

Grant Creation is Broken

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • General
    • 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);

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rgoulding Ryan Goulding
            rgoulding Ryan Goulding
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: