• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 #ifndef ACCESSTOKEN_HAP_TOKEN_INFO_H
17 #define ACCESSTOKEN_HAP_TOKEN_INFO_H
18 
19 #include "access_token.h"
20 #include "permission_def.h"
21 #include "permission_state_full.h"
22 #include <string>
23 #include <vector>
24 
25 namespace OHOS {
26 namespace Security {
27 namespace AccessToken {
28 class HapInfoParams final {
29 public:
30     int userID;
31     std::string bundleName;
32     int instIndex;
33     int dlpType;
34     std::string appIDDesc;
35     int32_t apiVersion;
36 };
37 
38 class HapPolicyParams final {
39 public:
40     ATokenAplEnum apl;
41     std::string domain;
42     std::vector<PermissionDef> permList;
43     std::vector<PermissionStateFull> permStateList;
44 };
45 
46 class HapTokenInfo final {
47 public:
48     ATokenAplEnum apl;
49     char ver;
50     int userID;
51     std::string bundleName;
52     int32_t apiVersion;
53     int instIndex;
54     int dlpType;
55     std::string appID;
56     std::string deviceID;
57     AccessTokenID tokenID;
58     AccessTokenAttr tokenAttr;
59 };
60 
61 class HapTokenInfoForSync final {
62 public:
63     HapTokenInfo baseInfo;
64     std::vector<PermissionStateFull> permStateList;
65 };
66 } // namespace AccessToken
67 } // namespace Security
68 } // namespace OHOS
69 #endif // ACCESSTOKEN_HAP_TOKEN_INFO_H
70