仓颉程序访问控制能力封装层
Access rate limit exceeded. Please log in to continue.
accesscontrol_cangjie_wrapper
Introduction
The accesscontrol_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony based on the access_token capability. The access_token information of the application mainly includes the application identity APPID, user ID, application clone index, application APL (Ability Privilege Level) level, application permission information, etc. The access_token information of each application is identified by a 32-bit unique device identifier, TokenID. Cangjie apis provides APIs for application permission management, including authentication and authorization. The currently accesscontrol Cangjie api only supports standard devices.
System Architecture
Figure 1 System architecture of accesscontrol_cangjie_wrapper

As shown in the architecture diagram:
- requestPermissionsFromUser: Developers can call the requestPermissionsFromUser to request user authorization, and the result of this permission application will be returned.
- checkAccessToken: accesscontrol_cangjie_wrapper provides permission verification and management capabilities for applications. Developers can use checkAccessToken to check whether an application has been authorized.
- Cangjie Accesscontrol FFI interface: Based on cross-language interoperability via C interfaces to implement accesscontrol Cangjie API.
- access_token: It is responsible for providing basic functions of application access control, and encapsulates C interfaces to provide interoperability for Cangjie.
Directory Structure
The source code of the program access control is under base/accesscontrol/accesstrol_cangjie_wrapper
base/accesscontrol/accesscontrol_cangjie_wrapper
├── figures # architecture pictures
├── ohos # Cangjie program access control interface
│ ├── ability_access_ctrl # Cangjie program access control management interface
│ └── security # Permission request result object
└── test # Cangjie test code
Usage Guidelines
The following features are provided:
- The AbilityAccessCtrl module provides APIs for application permission management, including authentication and authorization.
- The PermissionRequestResult module defines the permission request result returned by requestPermissionsFromUser.
The following features are not provided yet:
- Check the status of application permissions.
- Displays a dialog box for setting a global swich.
- Displays a permission settings dialog box to grant permissions the second time.
For Accesscontrol-related APIs, please refer to ohos.ability_access_ctrl (Application Access Control Management). For relevant guidance, please refer to Access Control Overview.
Code Contribution
Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.