User: rt      
Date: 05/06/27 01:25:07

Modified:
 /dba/connectivity/source/drivers/hsqldb/
  HTables.cxx

Log:
 INTEGRATION: CWS hslqdb3 (1.2.22); FILE MERGED
 2005/06/21 14:14:14 fs 1.2.22.1: #i45749# properly determine table privileges

File Changes:

Directory: /dba/connectivity/source/drivers/hsqldb/
===================================================

File [changed]: HTables.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/hsqldb/HTables.cxx?r1=1.2&r2=1.3
Delta lines:  +7 -24
--------------------
--- HTables.cxx 6 Apr 2005 10:35:50 -0000       1.2
+++ HTables.cxx 27 Jun 2005 08:25:04 -0000      1.3
@@ -146,28 +146,11 @@
         Reference< XRow > xRow(xResult,UNO_QUERY);
                if ( xResult->next() ) // there can be only one table with this 
name
                {
-//                     Reference<XStatement> xStmt = 
m_xConnection->createStatement();
-//                     if ( xStmt.is() )
-//                     {
-//                             Reference< XResultSet > xPrivRes = 
xStmt->executeQuery();
-//                             Reference< XRow > xPrivRow(xPrivRes,UNO_QUERY);
-//                             while ( xPrivRes.is() && xPrivRes->next() )
-//                             {
-//                                     if ( xPrivRow->getString(1) )
-//                                     {
-//                                     }
-//                             }
-//                     }
-                       sal_Int32 nPrivileges = Privilege::DROP                 
| 
-                                                                       
Privilege::REFERENCE    | 
-                                                                       
Privilege::ALTER                |
-                                                                       
Privilege::CREATE               |
-                                                                       
Privilege::READ                 |
-                                                                       
Privilege::DELETE               |
-                                                                       
Privilege::UPDATE               |
-                                                                       
Privilege::INSERT               |
-                                                                       
Privilege::SELECT;
+            sal_Int32 nPrivileges = ::dbtools::getTablePrivileges( 
m_xMetaData, sCatalog, sSchema, sTable );
+            if ( m_xMetaData->isReadOnly() )
+                nPrivileges &= ~( Privilege::INSERT | Privilege::UPDATE | 
Privilege::DELETE | Privilege::CREATE | Privilege::ALTER | Privilege::DROP );
 
+            // obtain privileges
                        OHSQLTable* pRet = new OHSQLTable( this
                                                                                
                ,static_cast<OHCatalog&>(m_rParent).getConnection()
                                                                                
                ,sTable




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

Reply via email to