• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 native_token_info.h
33  *
34  * @brief Declares native token infos.
35  *
36  * @since 7.0
37  * @version 7.0
38  */
39 
40 #ifndef ACCESSTOKEN_NATIVE_TOKEN_INFO_H
41 #define ACCESSTOKEN_NATIVE_TOKEN_INFO_H
42 
43 #include "access_token.h"
44 #include <string>
45 #include <vector>
46 #include "permission_state_full.h"
47 
48 namespace OHOS {
49 namespace Security {
50 namespace AccessToken {
51 /**
52  * @brief Declares native token info class
53  */
54 class NativeTokenInfo final {
55 public:
56     /**
57      * apl level, for details about the valid values,
58      * see the definition of ATokenAplEnum in the access_token.h file.
59      */
60     ATokenAplEnum apl;
61     unsigned char ver;
62     /** native process name */
63     std::string processName;
64     /** capsbility list */
65     std::vector<std::string> dcap;
66     AccessTokenID tokenID;
67     /** token attribute */
68     AccessTokenAttr tokenAttr;
69     /** native process access control permission list */
70     std::vector<std::string> nativeAcls;
71 };
72 
73 /**
74  * @brief Declares native token info for distributed synchronize class
75  */
76 class NativeTokenInfoForSync final {
77 public:
78     /** native token info */
79     NativeTokenInfo baseInfo;
80     /** permission state list */
81     std::vector<PermissionStateFull> permStateList;
82 };
83 } // namespace AccessToken
84 } // namespace Security
85 } // namespace OHOS
86 #endif // ACCESSTOKEN_NATIVE_TOKEN_INFO_H
87