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