harmony 鸿蒙Application Permission Groups

  • 2025-06-12
  • 浏览 (2)

Application Permission Groups

Usage Guidelines

  • It will be helpful if you understand permission groups and permissions before requesting permission groups for your application.

  • A permission group is a logical grouping of related permissions. When a permission is requested, the members of the group are presented together in the user interface, making it easier for the user to manage permissions. If the user grants the permission, all the permissions in the permission group will be granted in a unified manner. For security purposes, the Location, Contacts, Call Logs, Phone, Messaging, and Calendar permission groups do not support unified authorization.

The following uses the Location and Camera permission groups as an example.

  • When an application requests only the ohos.permission.APPROXIMATELY_LOCATION permission (belong to the Location permission group), a dialog box containing only the requested permission will be displayed to request user authorization.

  • When an application requests the ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION permissions (belonging to the Location permission group), a dialog box containing only the requested permissions will be displayed to request user authorization.

  • When an application requests ohos.permission.APPROXIMATELY_LOCATION (belonging to the Location permission group) and ohos.permission.CAMERA (belonging to the Camera permission group), two dialog boxes will be displayed to request the location and camera permissions, respectively.

  • The following lists the permission groups supported by the system. For details about the permissions, see Open user_grant Permissions.

Location Information

Camera

Microphone

Contacts

Calendar

Fitness

Body Sensors

Images and Videos

Music and Audio

Ad Tracking

Installed Bundle List

Multi-device Collaboration

Bluetooth

NearLink

Phone

Call Logs

Messaging

Pasteboard

Directory

NOTE
The permissions are available only to 2-in-1 device applications.

Files(deprecated)

NOTE This permission group is deprecated since API version 12.

  • ohos.permission.READ_DOCUMENT

  • ohos.permission.WRITE_DOCUMENT

  • ohos.permission.READ_MEDIA

  • ohos.permission.WRITE_MEDIA

Alternative solution:

  • To read or write images or videos in the media library:

  • To read audio clips in the media library:

Request the restricted permission ohos.permission.READ_AUDIO or ohos.permission.WRITE_AUDIO.

  • To read documents in Files:

Use the file Picker to read documents in Files. For details, see Selecting Documents and Saving Documents.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Application Access Control

harmony 鸿蒙Access Control Overview

harmony 鸿蒙Application Permission Management Overview

harmony 鸿蒙Application Permissions

harmony 鸿蒙Requesting Restricted Permissions

harmony 鸿蒙Declaring Permissions

harmony 鸿蒙Workflow for Requesting Permissions

harmony 鸿蒙Requesting One-Time User Authorization

harmony 鸿蒙Using PasteButton

harmony 鸿蒙Open user_grant Permissions

0  赞