jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Lützkendorf <luetzkend...@apache.org>
Subject Re: CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Date Wed, 06 Apr 2005 09:26:44 GMT
Hi Martin,
I applied your patch to the CVS HEAD.

Thanks, Stefan

Martin Kalén wrote:
> Martin Kalén wrote:
> 
>>  CommonRDBMSAdapter#revokePermission(Connection,Uri,NodePermission) is
>> broken in CVS [1] since the fix for Bugzilla id #31820 [2].
> 
> 
> The attached unified diff fixes this.
> 
> Tested with Oracle9i but should apply to all RDBMS
> without explicit override of this method.
> 
> Please advice if you would rather like the patch attached in a
> re-opened Bugzilla issue (#31820).
> 
> Regards,
>  Martin
> 
> 
> ------------------------------------------------------------------------
> 
> Index: src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java,v
> retrieving revision 1.9
> diff -u -r1.9 CommonRDBMSAdapter.java
> --- src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java	30 Oct 2004
13:46:25 -0000	1.9
> +++ src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java	6 Apr 2005 08:44:24
-0000
> @@ -225,10 +225,18 @@
>          if (permission == null) return;
>          PreparedStatement statement = null;
>          try {
> -            NodeRevisionNumber revisionNumber = permission.getRevisionNumber();
> +            final NodeRevisionNumber revisionNumber;
> +            final String versionNoCriteria;
> +
> +            revisionNumber = permission.getRevisionNumber();
> +            if (revisionNumber == null) {
> +                versionNoCriteria = "IS NULL";
> +            } else {
> +                versionNoCriteria = "= '" + revisionNumber.toString() + "'";
> +            }
>              statement =
>                  connection.prepareStatement(
> -                    "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select
ou.URI_ID from URI ou, URI su, URI au where ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and
su.URI_STRING = ? and ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO" + ((revisionNumber
== null) ? " IS NULL " : " = '" + revisionNumber.toString() + "'"));
> +                    "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select
ou.URI_ID from URI ou, URI su, URI au where ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and
su.URI_STRING = ? and ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO " + versionNoCriteria
+ ")");
>              statement.setString(1, permission.getObjectUri());
>              statement.setString(2, permission.getSubjectUri());
>              statement.setString(3, permission.getActionUri());
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org


-- 
Stefan Lützkendorf  --  luetzkendorf@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Mime
View raw message