DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34343>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34343

           Summary: revokePermission in PostgresRDBMSAdapter.java doesn't
                    work
           Product: Slide
           Version: Nightly
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: Stores
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


File: PostgresRDBMSAdapter.java
Method: public void revokePermission(Connection connection, Uri uri,
NodePermission permission) throws ServiceAccessException

This method doesn't work. Query is wrong and is crashing on PostgreSQL 8.0.
I changed query to:

      try {
                        NodeRevisionNumber revisionNumber =
permission.getRevisionNumber();
                        if (revisionNumber == null)
                                statement = connection.prepareStatement(
                                        "delete from PERMISSIONS where
(OBJECT_ID, SUBJECT_ID, ACTION_ID) IN ( SELECT ou.URI_ID, su.URI_ID, au.URI_ID
FROM URI ou, URI su, URI au WHERE ou.URI_STRING = ? and su.URI_STRING = ? and
au.URI_STRING = ?) and VERSION_NO IS NULL");
                        else
                                statement = connection.prepareStatement(
                                        "delete from PERMISSIONS where
(OBJECT_ID, SUBJECT_ID, ACTION_ID) IN ( SELECT ou.URI_ID, su.URI_ID, au.URI_ID
FROM URI ou, URI su, URI au WHERE ou.URI_STRING = ? and su.URI_STRING = ? and
au.URI_STRING = ?) and VERSION_NO = ?");

                        statement.setString(1, permission.getObjectUri());
                        statement.setString(2, permission.getSubjectUri());
                        statement.setString(3, permission.getActionUri());
                        if (revisionNumber != null)
                                statement.setString(4, 
revisionNumber.toString());
                        statement.executeUpdate();

Then it seems to work fine.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to