1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup AccessToken
18  * @{
19  *
20  * @brief Provides permission management interfaces.
21  *
22  * Provides tokenID-based application permission verification mechanism.
23  * When an application accesses sensitive data or APIs, this module can check
24  * whether the application has the corresponding permission. Allows applications
25  * to query their access token information or APL levcels based on token IDs.
26  *
27  * @since 7.0
28  * @version 7.0
29  */
30 
31 /**
32  * @file access_token_error.h
33  *
34  * @brief Declares error numbers.
35  *
36  * @since 7.0
37  * @version 7.0
38  */
39 
40 #ifndef ACCESS_TOKEN_ERROR_H
41 #define ACCESS_TOKEN_ERROR_H
42 
43 namespace OHOS {
44 namespace Security {
45 namespace AccessToken {
46 /**
47  * @brief error numbers
48  */
49 enum AccessTokenError {
50     ERR_PERMISSION_DENIED = 201,
51     ERR_NOT_SYSTEM_APP = 202,
52     ERR_PARAM_INVALID = 12100001,
53     ERR_TOKEN_INVALID,
54     ERR_TOKEN_MAP_FAILED,
55     ERR_TOKENID_NOT_EXIST,
56     ERR_TOKENID_HAS_EXISTED,
57     ERR_TOKENID_CREATE_FAILED,
58     ERR_PERMISSION_NOT_EXIST,
59     ERR_INTERFACE_NOT_USED_TOGETHER,
60     ERR_CALLBACK_ALREADY_EXIST,
61     ERR_CALLBACKS_EXCEED_LIMITATION,
62     ERR_IDENTITY_CHECK_FAILED,
63     ERR_SERVICE_ABNORMAL,
64     ERR_MALLOC_FAILED,
65     ERR_DEVICE_NOT_EXIST,
66     ERR_PROCESS_NOT_EXIST,
67     ERR_OVERSIZE,
68     ERROR_IPC_REQUEST_FAIL,
69     ERR_READ_PARCEL_FAILED,
70     ERR_WRITE_PARCEL_FAILED,
71     ERR_CHECK_DCAP_FAIL,
72     ERR_FILE_OPERATE_FAILED,
73     ERR_DATABASE_OPERATE_FAILED,
74     ERR_SIZE_NOT_EQUAL,
75     ERR_PERM_REQUEST_CFG_FAILED,
76     ERR_LOAD_SO_FAILED,
77     ERR_REMOTE_CONNECTION,
78 };
79 } // namespace AccessToken
80 } // namespace Security
81 } // namespace OHOS
82 
83 #endif  // ACCESS_TOKEN_ERROR_H