1 /*
2  * Copyright (c) 2023 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 OHOS_EXTENSION_PERMISSIONS_UTIL_H
17 #define OHOS_EXTENSION_PERMISSIONS_UTIL_H
18 
19 #include "extension_ability_info.h"
20 
21 namespace OHOS {
22 namespace AAFwk {
23 /**
24  * @class ExtensionPermissionsUtil
25  * provides extension permission utilities.
26  */
27 class ExtensionPermissionsUtil final {
28 public:
29     /**
30      * CheckSAPermission, check if it has SA permissions.
31      *
32      * @param extensionType The extension type.
33      * @return Whether it has SA permissions.
34      */
35     static bool CheckSAPermission(const AppExecFwk::ExtensionAbilityType &extensionType);
36 
37     /**
38      * CheckSAPermissionMore, check if it has SA permissions or more.
39      *
40      * @param extensionType The extension type.
41      * @return Whether it has SA permissions or more.
42      */
43     static bool CheckSAPermissionMore(const AppExecFwk::ExtensionAbilityType &extensionType);
44 };
45 
46 } // namespace AAFwk
47 } // namespace OHOS
48 #endif // OHOS_EXTENSION_PERMISSIONS_UTIL_H