top

Adding Permissions and Privileges to a Widget

To use some PPAPI interfaces you will need additional permissions. This article shows how to add privileges in Tizen Studio for a NaCl project and also presents all PPAPI permissions with mapped privileges.

Tizen privileges are saved in config.xml and are common for all Tizen applications. However, NaCl module needs PPAPI permissions which are needed to use Pepper interface. These permissions are saved in the nmf file.

Tizen Studio automatically translates selected Tizen privileges to PPAPI permissions.

Adding Permissions through Tizen Studio

When you build a NaCl project in Tizen Studio, configuration files such as config.xml and <PROJECT_NAME>.nmf are generated automatically. These files should not be modified manually. To add any privilege to the widget you need to go to project’s Properties, select Tizen Privileges and then select the needed ones from the list of all available privileges.

Important

Tizen Studio can automatically add privileges by scanning the source code based on included interfaces’ headers. Unfortunately, the auto-scanning does not find headers in files outside of your project.

The mapping of PPAPI permission to Tizen privileges is shown in the table below. After applying these properties, the project will automatically rebuild. Next, click on the project and select Build Package. In the output directory you will have your <PROJECT_NAME>.wgt widget with all the selected privileges set. You can verify if all the permissions you need were set by opening the <PROJECT_NAME>.nmf file and checking the permissions entry.

Below you can see the output nmf file after adding the http://tizen.org/privilege/filesystem.write privilege to the project in Tizen Studio.

{
  "permissions" : [ "PPB_FileIO", "PPB_FileIO_Private", "PPB_FileRef", "PPB_FileSystem", "PPB_RemovableStorage_Dev" ],
  "files" : { },
  "program" : {
    "arm" : {
      "url" : "project_name_armv7.nexe"
    },
  }
}

Mapping PPAPI Permissions to Tizen Privileges

Note

The name of the interface and the name of the permission needed by it are the same.

Important

When one permission is mapped to more than one privilege, you have to include all these privileges.

Permission Privilege
PPB_AudioInput_Dev http://developer.samsung.com/privilege/audiorecorder
PPB_AudioInput_Dev http://tizen.org/privilege/mediacapture
PPB_DeviceControl_Samsung http://developer.samsung.com/privilege/epg
PPB_FileIO http://tizen.org/privilege/filesystem.write
PPB_FileIO_Private http://tizen.org/privilege/filesystem.write
PPB_FileRef http://tizen.org/privilege/filesystem.write
PPB_FileSystem http://tizen.org/privilege/filesystem.write
PPB_Fullscreen http://tizen.org/privilege/fullscreen
PPB_NetworkMonitor http://developer.samsung.com/privilege/network.public
PPB_ProgramSchedule_Samsung http://developer.samsung.com/privilege/epg
PPB_RemovableStorage_Dev http://tizen.org/privilege/filesystem.write
PPB_ServiceList_Samsung http://developer.samsung.com/privilege/epg
PPB_SystemInfo http://tizen.org/privilege/system
PPB_VideoCapture_Dev http://tizen.org/privilege/mediacapture

Other Useful Permission Mapping

Permission Privilege
RemoteController http://tizen.org/privilege/tv.inputdevice
Internet http://tizen.org/privilege/internet
DRM http://developer.samsung.com/privilege/drmplay
DRM http://developer.samsung.com/privilege/drminfo

To read more about Tizen Privileges, check https://www.tizen.org/privilege.