1 /* 2 * Copyright (C) 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 #ifndef PERMISSION_TOOLS_H 16 #define PERMISSION_TOOLS_H 17 18 #include <string> 19 20 namespace OHOS { 21 namespace NFC { 22 // the app need request the permission for open/close nfc operations. 23 const std::string SYS_PERM = "ohos.permission.MANAGE_SECURE_SETTINGS"; 24 25 // the app need request the permission for tag operations. 26 const std::string TAG_PERM = "ohos.permission.NFC_TAG"; 27 28 // the app need request the permission for card emulation operations. 29 const std::string CARD_EMU_PERM = "ohos.permission.NFC_CARD_EMULATION"; 30 31 class PermissionTools { 32 public: 33 /** 34 * @Description : Check the Permission. 35 * @param permission - the permission to be checked 36 * @return true: granted; false: not granted 37 */ 38 static bool IsGranted(std::string permission); 39 }; 40 } // namespace NFC 41 } // namespace OHOS 42 #endif // PERMISSION_TOOLS_H 43