rim:permit element

Syntax

<rim:permissions>
    <rim:permit>permission string</rim:permit>
</rim:permissions>

Description

The <rim:permit> element specifies permission access to various features in a BlackBerry WebWorks application (for example, accessing the GPS location or the camera).

You must include the following namespace declaration in the top-level <widget> element to use the <rim:permit> element:

xmlns:rim="http://www.blackberry.com/ns/widgets">

Parent elements

<rim:permissions>

Child elements

None

Occurrences

One or more

Attributes

You can specify the following attributes:

Attribute Description
system The system attribute indicates that the specified permission is a system permission. Set system="true" to indicate a system permission.

Currently, the only permission that must be specified as a system permission is _sys_use_consumer_push.

Permissions

The following table identifies the available permissions for WebWorks plugins, which are required to access specific native functionality or capabilities.

This list of permissions represents only those permissions that may be required when adding the WebWorks or Cordova plugins that are installed with the BlackBerry 10 WebWorks SDK. Custom plugins may require permissions that are not listed here. For example, to use a custom plugin that accesses the device's microphone to record audio, you must add the record_audio permission. For a complete list of native app permissions, see App permissions in the BlackBerry 10 Native SDK documentation.

Functionality or Capabilities Permission value Description
Camera

use_camera

Allows this app to take pictures, record video, and use the camera's flash.

Device information

read_device_identifying_information

Allows this app to access device identifiers such as serial number and PIN.

Location information

access_location_services

Allows this app to access the device’s current or saved locations. This permission replaces read_geolocation, and includes access to location information from GPS, Wi-Fi, and cell ID.

Shared files

access_shared

Allows this app to access pictures, music, documents, and other files stored on the device, at a remote storage provider, on a media card, or in the cloud.

Push

_sys_use_consumer_push

Allows this app to use push functionality.

Run in background

run_when_backgrounded

Allows this app to run JavaScript and networking in the background.

Your app can run in the background either by including the run_when_backgrounded permission, or by adding the com.blackberry.push plugin.

Use this feature sparingly and only when your application must perform processing in the background.

BBM Social Platform

bbm_connect

Allows this app to connect to BBM so that the user can chat or update their BBM profile without leaving the BBM connected app.

Email and PIN messages

access_pimdomain_messages

Allows this app to access email and PIN messages, including viewing, creating, sending, and deleting messages.

Contacts

access_pimdomain_contacts

Allows this app to access contacts, including viewing, creating, and deleting contacts.

Calendar

access_pimdomain_calendars

Allows this app to access the calendar, including viewing, adding, and deleting appointments.

Notifications

post_notifications

Allows this app to post a notification to the notification area of the screen.

Example: Specifying permissions

The following example demonstrates how to set the permissions for reading and writing files, recording audio, accessing camera data, and push.

<widget xmlns:rim="http://www.blackberry.com/ns/widgets">
.
.
.
    <rim:permissions>
        <rim:permit>access_shared</rim:permit>
        <rim:permit>record_audio</rim:permit>
        <rim:permit>use_camera</rim:permit>
        <rim:permit system="true">_sys_use_consumer_push</rim:permit>
    </rim:permissions>
<widget>

Last modified: 2014-03-14

comments powered by Disqus