1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 module com
{ module sun
{ module star
{ module security
{
25 /** Interface for checking permissions and invoking privileged or restricted
30 published
interface XAccessController
: com
::sun
::star
::uno
::XInterface
32 /** Determines whether the access request indicated by the specified
33 permission should be allowed or denied, based on the security policy
35 The semantics are equivalent to the security permission classes of
38 You can also pass a sequence of permissions (sequence< any >) to check
39 a set of permissions, e.g. for performance reasons.
40 This method quietly returns if the access request is permitted,
41 or throws a suitable AccessControlException otherwise.
45 permission to be checked
47 @throws AccessControlException
48 thrown if access is denied
50 @see ::com::sun::star::security::AccessControlException
51 @see ::com::sun::star::security::AllPermission
52 @see ::com::sun::star::security::RuntimePermission
53 @see ::com::sun::star::io::FilePermission
54 @see ::com::sun::star::connection::SocketPermission
58 raises
(AccessControlException
);
60 /** Perform the specified action restricting permissions to the given
61 XAccessControlContext.
62 The action is performed with the intersection of the permissions of the currently installed
63 XAccessControlContext, the given XAccessControlContext and the security policy currently
64 in effect. The latter includes static security, e.g. based on user credentials.
66 If the specified XAccessControlContext is null, then the action is performed
67 with unmodified permissions, i.e. the call makes no sense.
71 action object to be executed
73 access control context to restrict permission; null for no restriction
76 @throws com::sun::star::uno::Exception
77 any UNO exception may be thrown
81 [in] XAccessControlContext restriction
)
82 raises
(com
::sun
::star
::uno
::Exception
);
84 /** Perform the specified action adding a set of permissions defined by the given
85 XAccessControlContext.
86 The action is performed with the union of the permissions of the currently installed
87 XAccessControlContext, the given XAccessControlContext and the security policy currently
88 in effect. The latter includes static security, e.g. based on user credentials.
90 If the given XAccessControlContext is null, then the action is performed
91 <b>only</b> with the permissions of the security policy currently in effect.
95 Do carefully use this method only for well known use-cases to avoid exploits!
96 Script engines executing sandboxed scripts should generally deny calling this
100 action object to be executed
102 access control context to restrict permission; null for no restriction
105 @throws com::sun::star::uno::Exception
106 any UNO exception may be thrown
110 [in] XAccessControlContext restriction
)
111 raises
(com
::sun
::star
::uno
::Exception
);
113 /** This method takes a "snapshot" of the current calling context
116 This context may then be checked at a later point, possibly in another thread.
121 XAccessControlContext getContext
();
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */