# security\_permission - [Introduction](#section11660541593) - [Directory Structure](#section161941989596) - [Constraints](#section119744591305) - [Usage](#section137768191623) - [Available APIs](#section1551164914237) - [Usage Guidelines](#section129654513264) - [Repositories Involved](#section1371113476307) ## Introduction In OpenHarmony, apps and system services run in independent sandboxes. Both processes and data are isolated from each other to protect the security of app data. However, services or apps running in the sandboxes provide some APIs to implement specific functionalities. To access these APIs across processes, apps in other sandboxes need the required permissions, which are granted and managed based on a permission management mechanism. - App permission management provides a mechanism for defining permissions, allowing system services and apps to define new permissions for their sensitive APIs. To access these APIs, other apps need the required permissions. - App permission management also allows apps to request permissions that are defined by the system or other apps. Upon obtaining the permissions, apps can access the sensitive APIs provided by the system or other apps. - In addition, app permission management allows users to view and manage the permission granting status. **Figure 1** App permission management architecture ![](figures/en-us_image_0000001113598272.png) App permission management provides permission management for the application framework subsystem and provides APIs for apps to request permissions and query the permission granting status. Currently, app permission management is available for mini, small and standard systems. - Mini system: refers to the system running on the devices whose memory is greater than or equal to 128 KiB and that are equipped with MCU processors such as ARM Cortex-M and 32-bit RISC-V. This system provides multiple lightweight network protocols and graphics frameworks, and a wide range of read/write components for the IoT bus. Typical products include connection modules, sensors, and wearables for smart home. - Small system: refers to the system running on the devices whose memory is greater than or equal to 1 MiB and that are equipped with app processors such as ARM Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, and routers, and event data recorders \(EDRs\) for smart travel. - Standard system: refers to the system running on the devices whose memory is greater than or equal to 128 MiB and that are equipped with app processors such as ARM Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays. ## Directory Structure ``` /base/security/permission ├── frameworks # Frameworks │ └── permission_standard # Permission management framework for the standard system ├── interfaces # APIs │ ├── innerkits # Internal APIs │ │ ├── permission_lite # Internal permission management APIs for the mini and small systems │ │ └── permission_standard # Internal permission management APIs for the standard system │ └── kits # External APIs │ ├── permission_lite # External permission management APIs for the mini and small systems │ └── permission_standard # External permission management APIs for the standard system └── services # Services ├── permission_lite # Permission management services for the mini and small systems └── permission_standard # Permission management services for the standard system ``` ## Constraints - Currently, C++ APIs are available only for local permission management in the standard system. Distributed permission management APIs are not provided yet. ## Usage ### Available APIs **App permission management for a standard system**: provides basic permission management and verification capabilities for the application framework subsystem of a standard system and is unavailable for third-party apps. The following table describes the available APIs.
int GetCommunicationStrategy(RegParams params, PolicyTrans **policies, unsigned int *policyNum) |
|
Checks whether a process has the permission to access an API of another process. |