Skip to content

Defining Feature Restriction Policy

Feature restriction policies enable you to control feature access for the selected application. Set these policies in SAP mobile service cockpit. You can add, allow, restrict, edit, or delete features.

When you edit a native or hybrid app or an app developed with the Mobile Development Kit in SAP mobile service cockpit, available feature plugins are listed on the Mobile Settings Exchange screen. Feature plugins are typically JavaScript APIs that provide access to the native APIs of the mobile device (for example, for Hybrid apps they are typically implemented as Apache Cordova plugins, such as Camera, Calendar, and Push). You can indicate features that should be restricted from the user.

When a plugin, for example, the bar code scanner plugin, is in a disabled state on the server, the application starts a settings exchange and does two things:

  • Invalidates the native side of the plugin.

  • Changes the namespace of the plugin to null.

You may later enable a plugin on the server side, and trigger a settings exchange. At that time, although the plugin is not present in the disabled list, the value of the cordova.plugins.barcodeScanner namespace remains null; this value is reset only if a page refresh occurs, and Cordova reloads the plugin namespaces.

The new feature restriction policy takes effect after you exit the application and restart it to allow Cordova to refresh all the namespaces.

Note

It is a good idea to verify that a specific feature is enabled before calling the feature in the Web application (or underlying component that consumes the application).

  1. In SAP mobile service cockpit, select Mobile Applications > Native/MDK or SAP Mobile Cards.

  2. Select an application, then select Mobile Settings Exchange under Assigned Features (or add it first).

  3. Under Feature Flags, you see the current status of feature restriction policies.

    Column Description
    Name A unique feature plugin name.
    Plugin A list of feature plugins that are available with the application, such as Camera, Calendar, and Push.
    ID Unique identifier for the feature plugin.
    Subscribed Indicates whether the feature plugin is inherited from the provider application. No indicates the feature is not provided on a subscription basis. Yes indicates the feature is provided on a subscription basis. Depending on the arrangement with the provider, some actions or access may not be available.
    Active Indicates whether the feature is allowed or restricted. On indicates the feature is allowed. Off indicates the feature is not allowed. For some features inherited from a provider, you may be able to activate a feature, or may be restricted.
    Actions The actions you can take, such as edit or delete. For features inherited from a provider, you may be restricted from these actions.
  4. (Optional) Select create to add a feature restriction policy for the selected application, and then OK.

    Field Description
    Name A unique feature name.
    Plugin A feature plugin that is available with the application, such as Camera, Calendar, and Push.
    Plugin Name Plugin name.
    Description A feature plugin description, such as Cordova Camera Plugin, Cordova Contacts Plugin, and SAP Push Plugin.
    JavaScript Module A comma-separated list of all JavaScript modules that are used by this plugin. The JavaScript Module value is the JavaScript API that is used to invoke the plugin.
    ID Unique identifier for the plugin. The value comes from the cordova_plugins.js file, which appears in the project after you add a plugin ("pluginId").
    Active Toggle the feature On (allowed) or Off (restricted). By default, features are allowed.
    Subscribed Indicates whether the feature plugin is inherited from the provider application.
  5. (Providers only) Under Feature Flags for SaaS Tenants, you see the current status of device feature plugins for your tenants, or select Enable Feature Flags for SaaS Tenants to enable the feature. See Defining Feature Restriction Policy for SaaS Providers) for details. If you are not a tenant provider, this section does not appear.

  6. Select Save.

Defining Feature Restriction Policy for SaaS Providers

Describes the end-to-end process for software-as-a-service providers to set feature restriction policies for their tenants. Before you start:

  • The SaaS provider production landscape must be in configured in SAP Business Technology Platform.

  • The SAP mobile service cockpit must implement storage service.

  • The runtime application settings must contain a saasFeatureVectorPolicies node.

  • To activate or deactivate specific tenants, you need their tenant IDs. You can obtain the tenant IDs in SAP Business Technology Platform cockpit, from the list of subaccount tenants.

This feature makes it possible for software providers to make mobile application feature plugins available to tenant subscribers. The plugins can be activated for all tenants, deactivated for all tenants, or activated/deactivated for a restricted list of tenants. Depending on the settings made, the feature plugin details may be read only, or may be edited or overridden.

  1. In SAP mobile service cockpit select Mobile Applications > Native/MDK or SAP Mobile Cards.

  2. Select an application, then select Mobile Settings Exchange under Assigned Features.

  3. Under Feature Flags for SaaS Tenants, select Enable Feature Flags for SaaS Tenants.

  4. When Enable Feature Flags for SaaS Tenants is enabled, you see the current status of device feature plugins for tenants.

    Column Description
    Name A unique feature plugin name.
    Plugin A list of feature plugins that are available with the application, such as Camera, Calendar, and Push.
    Active Indicates whether the feature is allowed or restricted for tenants. On indicates the feature is allowed for tenants. Off indicates the feature is not allowed for tenants.
    Tenant Overridable Indicates whether tenants can override this setting. For example, a tenant may decide they do not want their users to use a feature even though it is available.
    Actions The actions you can take, such as edit or delete.
  5. Select create to add a feature plugin for tenants, or select a row to edit in and click OK.

    Feature Flags for SaaS Tenants Properties

    Property Description
    Name Enter the feature name, such as Feature1 or SaaSFeature2.
    Plugin Enter the feature plugin.
    Plugin Name Enter the feature plugin name.
    Description Enter a description of the plugin.
    JavaScript Module Enter a list of features included in the plugin, such as Camera,navigator.camera,CameraPopoverOptions,CameraPopoverHandle.
    ID The plugin identifier, such as cordova-plugin.Feature1.
    Active Whether the feature flag is active for both the provider app (tenant) and the subscriber app. This value applies to all tenants, unless you specify otherwise. Select On if the feature flag is active. When set to On, the feature is available to all tenants. The property Deactive on Tenants appears, which enables you to turn off the feature flag for specific tenants. Select Off if the feature is inactive. When set to Off, the feature is not available to any tenants. The property "Active on Tenants" appears, which enables you to turn on the feature flag for specific tenants. This setting determines the default value for subscribers that appear in the Feature Flag table. See Defining Feature Restriction Policy.
    Active on Tenants If Active is set to Off (meaning the feature is inactive for all tenants), you can use this property to override the flag for specific tenants. Enter one or more tenant IDs. The feature is then activated for the tenants in this list.
    Deactive on Tenants If Active is set to On (meaning the feature is active for all tenants), you can use this property to override the flag for specific tenants. Enter one or more tenant IDs. The feature is then deactivated for the tenants in this list.
    Tenant Overridable Whether subscribers can override this setting. For example, a tenant may want to decide whether to make a feature available to its subscribers, or when to make it available.
  6. Select Save.

    Once you activate a feature for an app, it appears in the subscriber list of feature plugins. Depending on its settings, the feature may be read only, with no actions available to subscribers.

    If you make the feature tenant overridable, the tenant can decide whether to make the feature plugin available to subscribers. Depending on its settings, the feature may be read only, with no actions available to subscribers.


Last update: March 10, 2022