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