Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-2024119

AppScope/H25-Oct-20244 KiB

build-profile.json5H A D25-Oct-20241.1 KiB

entry/H25-Oct-20244 KiB

hvigor/H25-Oct-20244 KiB

hvigorfile.tsH A D25-Oct-2024158

hvigorwH A D25-Oct-20242.1 KiB

hvigorw.batH A D25-Oct-20242 KiB

oh-package.json5H A D25-Oct-2024823

ohosTest.mdH A D25-Oct-2024768

README.mdH A D25-Oct-20242 KiB

README_zh.mdH A D25-Oct-20244.6 KiB

requestPermission/H25-Oct-20244 KiB

screenshots/device/H25-Oct-20244 KiB

README.md

1# Access Permission Control
2
3### Introduction
4
5This sample shows how `@ohos.abilityAccessCtrl` works to implement app permission control. The display effect is as follows:
6
7![](screenshots/device/main_en.png) ![](screenshots/device/dialog_en.png)
8
9### Concepts
10
11Application access control: provides application permission management, including authentication, authorization, and authorization revocation.
12
13### Required Permissions
14
15- ohos.permission.GET_SENSITIVE_PERMISSIONS
16
17- ohos.permission.REVOKE_SENSITIVE_PERMISSIONS
18
19- ohos.permission.GRANT_SENSITIVE_PERMISSIONS
20
21- ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
22
23- ohos.permission.GET_BUNDLE_INFO
24
25- ohos.permission.MICROPHONE
26
27
28### Usage
29
301. Open the app. A dialog box is displayed, asking you whether to grant the permission. Touch **Cancel**.
31
322. The permission check screen is displayed. Touch the **Check Permission** button. A message is displayed, indicating that the permission is not granted.
33
343. Close the app and open it again. A dialog box is displayed, asking you whether to grant the permission. Touch **OK**.
35
364. The permission check screen is displayed. Touch the **Check Permission** button. A message is displayed, indicating that the permission has been granted.
37
385. Close the app and open it again. No dialog box is displayed. Touch the **Check Permission** button. A message is displayed, indicating that the permission has been granted.
39
40### Constraints
41
42- This sample can only be run on standard-system devices.
43
44- Before building a project, you need to run **Make Module 'entry'**.
45
46- This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) to compile and run.
47
48- The ohos.permission.GET_SENSITIVE_PERMISSIONS, ohos.permission.REVOKE_SENSITIVE_PERMISSIONS, and ohos.permission.GRANT_SENSITIVE_PERMISSIONS permissions used in this sample are of the system_core level. You need to configure signatures for these permissions. For details about the application permission level (APL), see [Permission List](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md).
49