• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Workflow for Requesting Permissions
2
3You 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.
4
5The procedure for requesting a permission varies depending on the permission level and authorization mode. Before requesting a permission, you need to:
6
71. Determine the permission type in the related permission list.
82. Request the permission by following the corresponding operation path.
9
10
11
12## Requesting Permissions for <!--Del-->normal <!--DelEnd-->Applications
13
14| Permission Type| Authorization Mode| Operation Path|
15| -------- | -------- | -------- |
16| [Open system_grant permission](permissions-for-all.md)| system_grant | [Declare permission](declare-permissions.md) &gt; Access API|
17| [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|
18| <!--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|
19| <!--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|
20
21<!--Del-->
22> **NOTE**
23>
24> - A normal application cannot request a system_basic permission whose **Enable via ACL** is **false**.
25> - 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.
26
27## Requesting Permissions for system_basic Applications
28
29| Permission APL| Authorization Mode| Enable via ACL| Operation Path|
30| -------- | -------- | -------- | -------- |
31| normal or system_basic| system_grant | - | [Declare permission](declare-permissions.md) &gt; Access API|
32| normal or system_basic| user_grant | - | [Declare permission](declare-permissions.md) &gt; [Request user authorization](request-user-authorization.md) &gt; Access API|
33| system_core | system_grant | true | [Request restricted permission](declare-permissions-in-acl.md) &gt; [Declare permission](declare-permissions.md) > Access API|
34| 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|
35
36To 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.
37
38**Example**
39
40Modify the **"bundle-info"** &gt; **"apl"** field in the file.
41
42```json
43"bundle-info" : {
44    // ...
45    "apl": "system_basic",
46    // ...
47},
48```
49
50> **NOTE**
51> 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.
52
53<!--DelEnd-->
54