sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FSecAccessController.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @if VISPARTNER
20  * @file        FSecAccessController.h
21  * @brief       This is the header file for the %AccessController class.
22  *
23  * This header file contains the declarations of the %AccessController class.
24  * @endif
25  */
26
27 #ifndef _FSEC_ACCESS_CONTROLLER_H_
28 #define _FSEC_ACCESS_CONTROLLER_H_
29
30 #include <FOspConfig.h>
31
32 namespace Tizen { namespace Security
33 {
34
35 /**
36  * @if VISPARTNER
37  * @class       AccessController
38  * @brief       This class provides a way to check the privilege and visibility of privileged API.
39  * @since 2.0
40  * @visibility partner
41  *
42  * The %AccessController class provides a way to check the privilege and visibility of privileged API.
43  * @endif
44  */
45 class _OSP_EXPORT_ AccessController
46 {
47
48 public:
49
50         /**
51          * @if VISPARTNER
52          *
53          * Checks whether the application has a privilege and a visibility to invoke the privileged API.
54          *
55          * @since 2.0
56          * @visibility  partner
57          * @return              An error code
58          * @param[in]   privilege                       A value of enumerator of the specified @c privilege
59          * @exception   E_SUCCESS                       The method is successful and the request is granted.
60          * @exception   E_DATA_NOT_FOUND        The privilege information does not exist.
61          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
62          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
63          * @exception   E_SYSTEM                        An unexpected system error has occurred.
64          * @endif
65          */
66         static result CheckPrivilege(int privilege);
67
68 private:
69
70     /**
71      * This default constructor is intentionally declared as private because this class cannot be constructed.
72      */
73         AccessController(void);
74
75     /**
76      * This destructor is intentionally declared as private because this class cannot be constructed.
77      */
78         ~AccessController(void);
79
80     /**
81      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
82      */
83         AccessController(const AccessController& rhs);
84
85     /**
86      * The implementation of this copy assignment operator is intentionally blank and delcared as private to prohibit copying of objects.
87      */
88         AccessController& operator =(const AccessController& rhs);
89
90         static void Initialize(void);
91
92 };  // AccessController
93
94 }} // Tizen::Security
95
96 #endif // _FSEC_ACCESS_CONTROLLER_H_