已关闭
访问控制Capi一致性整改 #5606
openharmony_devops创建于 7月14日关闭于 7月14日
访问控制Capi一致性整改 #5606
已关闭
共 2 个文件变更+64-8
| @@ -25,7 +25,7 @@ | |||
| 25 | /** | 25 | /** |
| 26 | * @file ability_access_control.h | 26 | * @file ability_access_control.h |
| 27 | * | 27 | * |
| 28 | - * @brief Declares the APIs for managing access token. | 28 | + * @brief Declares the APIs for implementing application access control. |
| 29 | * | 29 | * |
| 30 | * @library ability_access_control.so | 30 | * @library ability_access_control.so |
| 31 | * @kit AbilityKit | 31 | * @kit AbilityKit |
| @@ -42,13 +42,11 @@ | |||
| 42 | 42 | ||
| 43 | extern "C" { | 43 | extern "C" { |
| 44 | 44 | ||
| 45 | - | ||
| 46 | /** | 45 | /** |
| 47 | - * @brief Checks whether this application has been granted the given permission. | 46 | + * @brief Checks whether a permission is granted to this application. |
| 48 | - * | 47 | + * @param permission - Pointer to the permission to check. For details about the permission, |
| 49 | - * @param permission - Name of the permission to be granted. | 48 | + * see [the application permission list](docroot://security/AccessToken/app-permissions.md). |
| 50 | - * @return true - The permission has been granted to this application. | 49 | + * @return Returns true if the permission has been granted to the application. Returns false otherwise. |
| 51 | - * false - The permission has not been granted to this application. | ||
| 52 | * @since 12 | 50 | * @since 12 |
| 53 | */ | 51 | */ |
| 54 | bool OH_AT_CheckSelfPermission(const char *permission); | 52 | bool OH_AT_CheckSelfPermission(const char *permission); |
| @@ -58,4 +56,4 @@ bool OH_AT_CheckSelfPermission(const char *permission); | |||
| 58 | 56 | ||
| 59 | 57 | ||
| 60 | /** @} */ | 58 | /** @} */ |
| 61 | -#endif /* ABILITY_ACCESS_CONTROL_H */ | 59 | +#endif /* ABILITY_ACCESS_CONTROL_H */ |
| @@ -0,0 +1,58 @@ | |||
| 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 AbilityAccessControl | ||
| 18 | + * @{ | ||
| 19 | + * | ||
| 20 | + * @brief Provides the capability to manage access token. | ||
| 21 | + * | ||
| 22 | + * @since 12 | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @file ability_access_control.h | ||
| 27 | + * | ||
| 28 | + * @brief Declares the APIs for implementing application access control. | ||
| 29 | + * | ||
| 30 | + * @library ability_access_control.so | ||
| 31 | + * @kit AbilityKit | ||
| 32 | + * @syscap SystemCapability.Security.AccessToken | ||
| 33 | + * @since 12 | ||
| 34 | + */ | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 43 | +extern "C" { | ||
| 44 | + | ||
| 45 | +/** | ||
| 46 | + * @brief 校验应用是否被授予指定的权限。 | ||
| 47 | + * @param permission - 需要校验的权限名称,合法的权限名取值可在[应用权限列表](docroot://security/AccessToken/app-permissions.md)中查询。 | ||
| 48 | + * @return 如果应用已经被授予该权限,则返回true。反之,返回false。 | ||
| 49 | + * @since 12 | ||
| 50 | + */ | ||
| 51 | +bool OH_AT_CheckSelfPermission(const char *permission); | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | + | ||
| 57 | +/** @} */ | ||
| 58 | + | ||