1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XAccessController.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_security_XAccessController_idl__
31 #define __com_sun_star_security_XAccessController_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
36 #ifndef __com_sun_star_security_XAccessControlContext_idl__
37 #include
<com
/sun
/star
/security
/XAccessControlContext.idl
>
40 #ifndef __com_sun_star_security_XAction_idl__
41 #include
<com
/sun
/star
/security
/XAction.idl
>
44 #ifndef __com_sun_star_security_AccessControlException_idl__
45 #include
<com
/sun
/star
/security
/AccessControlException.idl
>
49 //=============================================================================
51 module com
{ module sun
{ module star
{ module security
{
53 //=============================================================================
55 /** Interface for checking permissions and invoking privileged or restricted
60 published
interface XAccessController
: com
::sun
::star
::uno
::XInterface
62 /** Determines whether the access request indicated by the specified
63 permission should be allowed or denied, based on the security policy
65 The semantics are equivalent to the security permission classes of
68 You can also pass a sequence of permissions (sequence< any >) to check
69 a set of permissions, e.g. for performance reasons.
70 This method quietly returns if the access request is permitted,
71 or throws a suitable AccessControlException otherwise.
75 permission to be checked
77 @throws AccessControlException
78 thrown if access is denied
80 @see ::com::sun::star::security::AccessControlException
81 @see ::com::sun::star::security::AllPermission
82 @see ::com::sun::star::security::RuntimePermission
83 @see ::com::sun::star::io::FilePermission
84 @see ::com::sun::star::connection::SocketPermission
88 raises
(AccessControlException
);
90 /** Perform the specified action restricting permissions to the given
91 XAccessControlContext.
92 The action is performed with the intersection of the permissions of the currently installed
93 XAccessControlContext, the given XAccessControlContext and the security policy currently
94 in effect. The latter includes static security, e.g. based on user credentials.
96 If the specified XAccessControlContext is null, then the action is performed
97 with unmodified permissions, i.e. the call makes no sense.
101 action object to be executed
103 access control context to restrict permission; null for no restriction
106 @throws com::sun::star::uno::Exception
107 any UNO exception may be thrown
111 [in] XAccessControlContext restriction
)
112 raises
(com
::sun
::star
::uno
::Exception
);
114 /** Perform the specified action adding a set of permissions defined by the given
115 XAccessControlContext.
116 The action is performed with the union of the permissions of the currently installed
117 XAccessControlContext, the given XAccessControlContext and the security policy currently
118 in effect. The latter includes static security, e.g. based on user credentials.
120 If the given XAccessControlContext is null, then the action is performed
121 <b>only</b> with the permissions of the security policy currently in effect.
125 Do carefully use this method only for well known use-cases to avoid exploits!
126 Script engines executing sandboxed scripts should generally deny calling this
130 action object to be executed
132 access control context to restrict permission; null for no restriction
135 @throws com::sun::star::uno::Exception
136 any UNO exception may be thrown
140 [in] XAccessControlContext restriction
)
141 raises
(com
::sun
::star
::uno
::Exception
);
143 /** This method takes a "snapshot" of the current calling context
146 This context may then be checked at a later point, possibly in another thread.
151 XAccessControlContext getContext
();
154 //=============================================================================