User Permissions

Since m allows many harmful or costly operations to happen automatically, the user can grant or deny permission for certain operations, for instance to write some files or to dial the phone.

Of course, from within a native module, you have almost complete control over the device, as you can ignore the permissions denied by the user if you want[4]. However, it is a good idea to conform to m standards, particularly if you think of writing your module for a broader audience.

Permissions are checked anywhere within ExecuteL() by two functions from class Runtime:

Alarm Server Example, Continued

In our alarm module, all functions read application data, so we check for ReadApp right at the beginning:

Runtime::Value ExecuteL(TInt index, Runtime::Value *params,
                        TInt paramCount, TRequestStatus &status)
{
  // all functions in this module require permission to read
  // application data, we should check for it
  runtime->CheckPermissionL(ReadAppPermission);
  // if the session is not connected, connect&nb