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 std::string appIDDesc; 34 }; 35 36 class HapPolicyParams final { 37 public: 38 ATokenAplEnum apl; 39 std::string domain; 40 std::vector<PermissionDef> permList; 41 std::vector<PermissionStateFull> permStateList; 42 }; 43 44 class HapTokenInfo final { 45 public: 46 ATokenAplEnum apl; 47 char ver; 48 int userID; 49 std::string bundleName; 50 int instIndex; 51 std::string appID; 52 std::string deviceID; 53 AccessTokenID tokenID; 54 AccessTokenAttr tokenAttr; 55 }; 56 57 class HapTokenInfoForSync final { 58 public: 59 HapTokenInfo baseInfo; 60 std::vector<PermissionStateFull> permStateList; 61 }; 62 } // namespace AccessToken 63 } // namespace Security 64 } // namespace OHOS 65 #endif // ACCESSTOKEN_HAP_TOKEN_INFO_H 66