1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_security_XAccessControlContext_idl__
24#define __com_sun_star_security_XAccessControlContext_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29#ifndef __com_sun_star_security_AccessControlException_idl__
30#include <com/sun/star/security/AccessControlException.idl>
31#endif
32
33
34//=============================================================================
35
36module com {  module sun {  module star {  module security {
37
38//=============================================================================
39
40/** An XAccessControlContext is used to make system resource access decisions
41	based on the context it encapsulates.
42	<p>
43	More specifically, it encapsulates a context and has methods to check
44	permissions equivalent to XAccessController interface,
45	with one difference:
46	The XAccessControlContext makes access decisions
47	based on the context it encapsulates, rather than
48	that of the current execution thread.
49	</p>
50
51    @since OOo 1.1.2
52*/
53published interface XAccessControlContext : com::sun::star::uno::XInterface
54{
55	/** Determines whether the access request indicated by the specified
56		permission should be allowed or denied, based on this context.
57        The semantics are equivalent to the security permission classes of
58        the Java platform.
59		<p>
60        You can also pass a sequence of permissions (sequence< any >) to check
61        a set of permissions, e.g. for performance reasons.
62		This method quietly returns if the access request is permitted,
63		or throws a suitable AccessControlException otherwise.
64		</p>
65
66		@param perm
67               permission to be checked
68
69		@throws AccessControlException
70				thrown if access is denied
71
72        @see ::com::sun::star::security::AccessControlException
73        @see ::com::sun::star::security::AllPermission
74        @see ::com::sun::star::security::RuntimePermission
75        @see ::com::sun::star::io::FilePermission
76        @see ::com::sun::star::connection::SocketPermission
77	*/
78	void checkPermission(
79        [in] any perm )
80		raises (AccessControlException);
81};
82
83//=============================================================================
84
85}; }; }; };
86
87#endif
88