Kaydet (Commit) c09e0ef0 authored tarafından Duncan Foster's avatar Duncan Foster

#i12215# XScriptSecurity::checkPermissions now returns void if permission

is granted.
Removed IllegalArgumentException from specification of
XScriptInfoAccess::getScriptLogicalNames
üst 683487f6
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptNameResolverImpl.cxx,v $
*
* $Revision: 1.22 $
* $Revision: 1.23 $
*
* last change: $Author: dfoster $ $Date: 2003-03-06 15:31:02 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -474,10 +474,12 @@ const ::rtl::OUString & docURI ) SAL_THROW ( ( RuntimeException, css::security::
// if we dealing with a document storage (ie. not user or share
// we need to check the permission
if( ( sid != scriptingConstantsPool.USER_STORAGE_ID ) &&
( sid != scriptingConstantsPool.SHARED_STORAGE_ID ) &&
( xScriptSecurity->checkPermission( docURI,
OUString::createFromAscii( "execute" ) ) == true ) )
( sid != scriptingConstantsPool.SHARED_STORAGE_ID ) )
{
xScriptSecurity->checkPermission( docURI,
OUString::createFromAscii( "execute" ) );
// if we get here, the checkPermission hasn't thrown an
// AccessControlException, ie. permission has been granted
OSL_TRACE( "ScriptNameResolverImpl::getStorageInstance: got execute permission for ID=%d", sid );
}
Reference< storage::XScriptStorageManager > xScriptStorageManager( xInterface, UNO_QUERY_THROW );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptSecurityManager.cxx,v $
*
* $Revision: 1.18 $
* $Revision: 1.19 $
*
* last change: $Author: jmrice $ $Date: 2003-03-07 11:02:42 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -379,7 +379,7 @@ throw ( RuntimeException )
* we can't see a good reason not to return a bool, rather than throw
* an exception if the request is not granted (as is the case in Java).
*/
sal_Bool ScriptSecurityManager::checkPermission( const OUString & scriptStorageURL,
void ScriptSecurityManager::checkPermission( const OUString & scriptStorageURL,
const OUString & permissionRequest )
throw ( RuntimeException, lang::IllegalArgumentException, security::AccessControlException )
{
......@@ -396,7 +396,7 @@ sal_Bool ScriptSecurityManager::checkPermission( const OUString & scriptStorageU
{
if ( ph_it->second.execPermission )
{
return true;
return;
}
else
{
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptSecurityManager.hxx,v $
*
* $Revision: 1.10 $
* $Revision: 1.11 $
*
* last change: $Author: jmrice $ $Date: 2003-03-07 11:02:42 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -101,7 +101,7 @@ public:
* checks to see if the requested permission can be granted
* checks to see whether the requested ScriptPeremission is allowed.
*/
sal_Bool checkPermission( const rtl::OUString & scriptStorageURL,
void checkPermission( const rtl::OUString & scriptStorageURL,
const rtl::OUString & permissionRequest )
throw ( css::uno::RuntimeException, css::lang::IllegalArgumentException,
css::security::AccessControlException );
......
......@@ -2,8 +2,8 @@
*
* $RCSfile: ScriptStorage.cxx,v $
*
* $Revision: 1.18 $
* last change: $Author: npower $ $Date: 2003-03-04 13:26:27 $
* $Revision: 1.19 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -556,8 +556,7 @@ ScriptStorage::writeMetadataHeader(
//*************************************************************************
Sequence< ::rtl::OUString >
ScriptStorage::getScriptLogicalNames()
throw ( lang::IllegalArgumentException,
RuntimeException )
throw ( RuntimeException )
{
Sequence< ::rtl::OUString > results;
ScriptInfo_hash::iterator h_it = mh_implementations.begin();
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptStorage.hxx,v $
*
* $Revision: 1.10 $
* $Revision: 1.11 $
*
* last change: $Author: npower $ $Date: 2003-02-12 16:21:43 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -149,7 +149,7 @@ public:
*/
virtual css::uno::Sequence< ::rtl::OUString >
SAL_CALL getScriptLogicalNames()
throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException );
throw ( css::uno::RuntimeException );
//=========================================================================
/**
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptStorageManager.cxx,v $
*
* $Revision: 1.24 $
* $Revision: 1.25 $
*
* last change: $Author: dfoster $ $Date: 2003-03-04 18:34:54 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -416,15 +416,14 @@ throw( RuntimeException )
}
//*************************************************************************
sal_Bool SAL_CALL
void SAL_CALL
ScriptStorageManager::checkPermission( const OUString &
scriptStorageURI, const OUString & permissionRequest )
throw ( RuntimeException, lang::IllegalArgumentException, css::security::AccessControlException )
{
sal_Bool result;
try
{
result = m_securityMgr.checkPermission( scriptStorageURI, permissionRequest );
m_securityMgr.checkPermission( scriptStorageURI, permissionRequest );
}
catch ( css::security::AccessControlException & e )
{
......@@ -444,7 +443,6 @@ throw ( RuntimeException, lang::IllegalArgumentException, css::security::AccessC
OUSTR( "ScriptStorageManager::checkPermission: RuntimeException: " ).concat(
e.Message ), Reference< XInterface >() );
}
return result;
}
//*************************************************************************
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: ScriptStorageManager.hxx,v $
*
* $Revision: 1.16 $
* $Revision: 1.17 $
*
* last change: $Author: dfoster $ $Date: 2003-03-04 12:33:32 $
* last change: $Author: dfoster $ $Date: 2003-03-12 15:54:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -214,7 +214,7 @@ public:
if there is no matching script name
*/
virtual sal_Bool SAL_CALL ScriptStorageManager::checkPermission(
virtual void SAL_CALL ScriptStorageManager::checkPermission(
const rtl::OUString & scriptStorageURI,
const rtl::OUString & permissionRequest )
throw ( css::uno::RuntimeException, css::lang::IllegalArgumentException,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment