1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_security_XAccessController_idl__
28 #define __com_sun_star_security_XAccessController_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
33 #ifndef __com_sun_star_security_XAccessControlContext_idl__
34 #include
<com
/sun
/star
/security
/XAccessControlContext.idl
>
37 #ifndef __com_sun_star_security_XAction_idl__
38 #include
<com
/sun
/star
/security
/XAction.idl
>
41 #ifndef __com_sun_star_security_AccessControlException_idl__
42 #include
<com
/sun
/star
/security
/AccessControlException.idl
>
46 //=============================================================================
48 module com
{ module sun
{ module star
{ module security
{
50 //=============================================================================
52 /** Interface for checking permissions and invoking privileged or restricted
57 published
interface XAccessController
: com
::sun
::star
::uno
::XInterface
59 /** Determines whether the access request indicated by the specified
60 permission should be allowed or denied, based on the security policy
62 The semantics are equivalent to the security permission classes of
65 You can also pass a sequence of permissions (sequence< any >) to check
66 a set of permissions, e.g. for performance reasons.
67 This method quietly returns if the access request is permitted,
68 or throws a suitable AccessControlException otherwise.
72 permission to be checked
74 @throws AccessControlException
75 thrown if access is denied
77 @see ::com::sun::star::security::AccessControlException
78 @see ::com::sun::star::security::AllPermission
79 @see ::com::sun::star::security::RuntimePermission
80 @see ::com::sun::star::io::FilePermission
81 @see ::com::sun::star::connection::SocketPermission
85 raises
(AccessControlException
);
87 /** Perform the specified action restricting permissions to the given
88 XAccessControlContext.
89 The action is performed with the intersection of the permissions of the currently installed
90 XAccessControlContext, the given XAccessControlContext and the security policy currently
91 in effect. The latter includes static security, e.g. based on user credentials.
93 If the specified XAccessControlContext is null, then the action is performed
94 with unmodified permissions, i.e. the call makes no sense.
98 action object to be executed
100 access control context to restrict permission; null for no restriction
103 @throws com::sun::star::uno::Exception
104 any UNO exception may be thrown
108 [in] XAccessControlContext restriction
)
109 raises
(com
::sun
::star
::uno
::Exception
);
111 /** Perform the specified action adding a set of permissions defined by the given
112 XAccessControlContext.
113 The action is performed with the union of the permissions of the currently installed
114 XAccessControlContext, the given XAccessControlContext and the security policy currently
115 in effect. The latter includes static security, e.g. based on user credentials.
117 If the given XAccessControlContext is null, then the action is performed
118 <b>only</b> with the permissions of the security policy currently in effect.
122 Do carefully use this method only for well known use-cases to avoid exploits!
123 Script engines executing sandboxed scripts should generally deny calling this
127 action object to be executed
129 access control context to restrict permission; null for no restriction
132 @throws com::sun::star::uno::Exception
133 any UNO exception may be thrown
137 [in] XAccessControlContext restriction
)
138 raises
(com
::sun
::star
::uno
::Exception
);
140 /** This method takes a "snapshot" of the current calling context
143 This context may then be checked at a later point, possibly in another thread.
148 XAccessControlContext getContext
();
151 //=============================================================================