1 /* 2 * Copyright (c) 2024 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 atm_tools_param_info.h 33 * 34 * @brief Declares atm tools param infos. 35 * 36 * @since 11.0 37 * @version 11.0 38 */ 39 40 #ifndef ATM_TOOLS_PARAM_INFO_H 41 #define ATM_TOOLS_PARAM_INFO_H 42 43 #include "access_token.h" 44 #include <string> 45 46 namespace OHOS { 47 namespace Security { 48 namespace AccessToken { 49 namespace { 50 static constexpr uint32_t INVALID_ATM_SET_STATUS = 2; 51 } 52 /** 53 * @brief Declares atm tools param class 54 */ 55 56 /** 57 * @brief Atm tools param info 58 */ 59 class AtmToolsParamInfo final { 60 public: 61 /** 62 * operate type, for details about the valid values, 63 * see the definition of OptType in the access_token.h file. 64 */ 65 OptType type = DEFAULT_OPER; 66 union { 67 AccessTokenID tokenId = 0; 68 int32_t userID; 69 }; 70 uint32_t status = INVALID_ATM_SET_STATUS; 71 std::string permissionName; 72 std::string bundleName; 73 std::string processName; 74 ToggleModeType toggleMode = TOGGLE_REQUEST; 75 }; 76 } // namespace AccessToken 77 } // namespace Security 78 } // namespace OHOS 79 #endif // ATM_TOOLS_PARAM_INFO_H 80