• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Workflow for Requesting Permissions
2
3<!--Kit: Ability Kit-->
4<!--Subsystem: Security-->
5<!--Owner: @xia-bubai-->
6<!--SE: @linshuqing; @hehehe-li-->
7<!--TSE: @leiyuqian-->
8
9You need to determine whether your application needs related permissions before accessing data or performing an operation. If permissions are required, request the permissions in the application installation package.
10
11The procedure for requesting a permission varies depending on the permission level and authorization mode. Before requesting a permission, you need to:
12
131. Determine the permission type of the target permission by referring to the permission list.
142. Request the permission by following the corresponding operation path.
15
16You can request a permission based on its level and authorization mode by referring to the following operation paths.
17
18## <!--Del-->Requesting Permissions for <!--Del-->normal <!--DelEnd-->Applications
19
20| Permission Type| Authorization Mode| Operation Path|
21| -------- | -------- | -------- |
22| [Open system_grant permission](permissions-for-all.md)| system_grant | [Declare permission](declare-permissions.md) &gt; Access API|
23| [Open user_grant permission](permissions-for-all-user.md)| user_grant  | [Declare permission](declare-permissions.md) &gt; [Request user authorization](request-user-authorization.md) &gt; Access API|
24| <!--Del-->[system_grant permission available for system applications via ACL](permissions-for-system-apps.md)<br><!--DelEnd-->[Restricted permission](restricted-permissions.md)| system_grant | <!--RP1-->[Request restricted permission](declare-permissions-in-acl.md)<!--RP1End--> &gt; [Declare permission](declare-permissions.md) > Access API|
25| <!--Del-->[user_grant permission available for system applications via ACL](permissions-for-system-apps-user.md)<br><!--DelEnd-->[Restricted permission](restricted-permissions.md)| user_grant | <!--RP1-->[Request restricted permission](declare-permissions-in-acl.md)<!--RP1End--> &gt; [Declare permission](declare-permissions.md) > [Request user authorization](request-user-authorization.md) > Access API|
26
27<!--Del-->
28> **NOTE**
29>
30> - A normal application cannot request a system_basic permission whose **Enable via ACL** is **false**.
31> - You can use DevEco Studio to [request a permission via ACL](https://developer.huawei.com/consumer/en/doc/harmonyos-guides/ide-signing). However, this approach applies to the applications in debug phase, but not to the applications to be released to an app market. For a commercial application, apply for a release certificate and profile in the app market.
32
33## Requesting Permissions for system_basic Applications
34
35| Permission APL| Authorization Mode| Enable via ACL| Operation Path|
36| -------- | -------- | -------- | -------- |
37| normal or system_basic| system_grant | - | [Declare permission](declare-permissions.md) &gt; Access API|
38| normal or system_basic| user_grant | - | [Declare permission](declare-permissions.md) &gt; [Request user authorization](request-user-authorization.md) &gt; Access API|
39| system_core | system_grant | true | [Request restricted permission](declare-permissions-in-acl.md) &gt; [Declare permission](declare-permissions.md) > Access API|
40| system_core | user_grant | true | [Request restricted permission](declare-permissions-in-acl.md) &gt; [Declare permission](declare-permissions.md) > [Request user authorization](request-user-authorization.md) > Access API|
41
42To change the application APL to system_basic or system_core, modify the HarmonyAppProvision file (**Toolchains / _{Version} _/ lib / UnsgnedReleasedProfileTemplate.json** file in the SDK directory) of the application when developing the application installation package, and sign the application again.
43
44**Example**
45
46Modify the **"bundle-info"** &gt; **"apl"** field in the **HarmonyAppProvision** configuration file.
47
48```json
49"bundle-info" : {
50    // ...
51    "apl": "system_basic",
52    // ...
53},
54```
55
56> **NOTE**
57>
58> Modifying the **HarmonyAppProvision** configuration file applies to the applications in the debug phase, but not to the applications released to the app market. For a commercial application, apply for a release certificate and profile in the app market.
59
60<!--DelEnd-->
61