API Documentation
Documentation for developing SailfishOS applicationsAccessPolicy Class
(Sailfish::AccessPolicy)The AccessPolicy class controls the access policy for a variety of settings. More...
Header: | #include <accesspolicy.h> |
Instantiated By: | AccessPolicy |
Properties
|
|
Public Functions
Signals
void | accountCreationEnabledChanged() |
void | applicationInstallationEnabledChanged() |
void | bluetoothToggleEnabledChanged() |
void | browserEnabledChanged() |
void | callStatisticsSettingsEnabledChanged() |
void | cameraEnabledChanged() |
void | cellularTechnologySettingsEnabledChanged() |
void | dateTimeSettingsEnabledChanged() |
void | developerModeSettingsEnabledChanged() |
void | deviceResetEnabledChanged() |
void | flightModeToggleEnabledChanged() |
void | internetSharingEnabledChanged() |
void | locationSettingsEnabledChanged() |
void | microphoneEnabledChanged() |
void | mobileDataAccessPointSettingsEnabledChanged() |
void | mobileNetworkSettingsEnabledChanged() |
void | networkDataCounterSettingsEnabledChanged() |
void | networkProxySettingsEnabledChanged() |
void | osUpdatesEnabledChanged() |
void | screenshotEnabledChanged() |
void | sideLoadingSettingsEnabledChanged() |
void | vpnConfigurationSettingsEnabledChanged() |
void | vpnConnectionSettingsEnabledChanged() |
void | wlanToggleEnabledChanged() |
Detailed Description
The AccessPolicy class controls the access policy for a variety of settings.
This is useful to the MDM application if it wants to "lock" the settings related to some subset of system functionality, so that some specific configuration is maintained.
Note that this class is merely a convenience wrapper around the PolicyValue class for specific policy types.
Property Documentation
accountCreationEnabled : const bool
This property holds true if the policy allows to modify accounts.
If the account setting policy is enabled, then the user has access to account's menu item.
Access functions:
bool | accountCreationEnabled() const |
Notifier signal:
void | accountCreationEnabledChanged() |
applicationInstallationEnabled : const bool
This property holds true if the application installations are allowed.
If the application installations are enabled, then the user is able to install applications and packages. If application installations are disabled, only MDM applications can install new applications.
Access functions:
bool | applicationInstallationEnabled() const |
Notifier signal:
void | applicationInstallationEnabledChanged() |
bluetoothToggleEnabled : const bool
This property holds true if the Bluetooth toggle setting is enabled.
If the Bluetooth toggle setting is enabled, then the user is able to enable or disable the Bluetooth. If the Bluetooth toggle setting is disabled, the user will be prevented from enabling or disabling Bluetooth, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | bluetoothToggleEnabled() const |
Notifier signal:
void | bluetoothToggleEnabledChanged() |
browserEnabled : const bool
This property holds true if the policy allows web browsing in the browser application.
If the browser policy is enabled, the user is able to use the browser app. If the browser policy is disabled, browser will display a message indicating this to the user, and will not allow websites to be viewed.
This property is considered experimental and may be changed or removed at a later date.
Access functions:
bool | browserEnabled() const |
Notifier signal:
void | browserEnabledChanged() |
callStatisticsSettingsEnabled : const bool
This property holds true if the call statistics policy is enabled.
If the call statistics policy is enabled, then the user is able to reset call statistic data.
Access functions:
bool | callStatisticsSettingsEnabled() const |
Notifier signal:
void | callStatisticsSettingsEnabledChanged() |
cameraEnabled : const bool
This property holds true if the policy allows enabling the camera.
If the camera policy is enabled, the user is able turn the camera on or off. If the camera policy is disabled, the configuration set by the MDM application will be maintained.
Access functions:
bool | cameraEnabled() const |
Notifier signal:
void | cameraEnabledChanged() |
cellularTechnologySettingsEnabled : const bool
This property holds true if the cellular technology selection settings are enabled.
If the cellular technology selection settings are enabled, then the user is able to change which technology (e.g. 2G, 3G, 4G) the device may use to access the cellular network.
If the cellular technology settings are disabled, the user will be prevented from changing the cellular technology selection, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | cellularTechnologySettingsEnabled() const |
Notifier signal:
void | cellularTechnologySettingsEnabledChanged() |
dateTimeSettingsEnabled : const bool
This property holds true if the policy allows changing the system date/time settings.
If the policy is enabled, the user is change the system date, time, time zone and whether these settings are automatically updated from a time server. If the policy is disabled, the configuration set by the MDM application will be maintained.
Access functions:
bool | dateTimeSettingsEnabled() const |
Notifier signal:
void | dateTimeSettingsEnabledChanged() |
developerModeSettingsEnabled : const bool
This property holds true if the developer mode settings are enabled.
If the developer mode settings are enabled, then the user is able to enable or disable developer mode, and use different developer mode settings. If the developer mode settings are disabled the configuration set by the MDM application will be maintained.
Access functions:
bool | developerModeSettingsEnabled() const |
Notifier signal:
void | developerModeSettingsEnabledChanged() |
deviceResetEnabled : const bool
This property holds true if the device reset policy is enabled.
If the device reset is enabled, then the user is able to execute device factory reset, clearing all the user data and reverting the OS to the original factory software. If the device reset is disabled, only MDM application can initialize the reset.
Access functions:
bool | deviceResetEnabled() const |
Notifier signal:
void | deviceResetEnabledChanged() |
flightModeToggleEnabled : const bool
This property holds true if the Flight Mode toggle setting is enabled.
If the Flight Mode toggle setting is enabled, then the user is able to enable or disable flight mode. If the Flight Mode toggle setting is disabled, the user will be prevented from enabling or disabling flight mode, thus the configuration set by the MDM application will be maintained.
Note that some network technologies (e.g. WLAN, Bluetooth, GPS) can be enabled or disabled separately, regardless of whether flight mode is enabled or disabled, unless their policies also prevent the user from changing those.
Access functions:
bool | flightModeToggleEnabled() const |
Notifier signal:
void | flightModeToggleEnabledChanged() |
internetSharingEnabled : const bool
This property holds true if the internet sharing setting is enabled.
If the internet sharing setting is enabled, then the user is able to enable or disable mobile internet sharing (tethering). If the internet sharing setting is disabled, the user will be prevented from enabling or disabling internet sharing, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | internetSharingEnabled() const |
Notifier signal:
void | internetSharingEnabledChanged() |
locationSettingsEnabled : const bool
This property holds true if the location settings are enabled.
If the location settings are enabled, then the user is able to enable or disable any positioning provider. If the location settings are disabled, the user will be prevented from enabling or disabling location providers, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | locationSettingsEnabled() const |
Notifier signal:
void | locationSettingsEnabledChanged() |
microphoneEnabled : const bool
This property holds true if the microphone policy is enabled.
Access functions:
bool | microphoneEnabled() const |
Notifier signal:
void | microphoneEnabledChanged() |
mobileDataAccessPointSettingsEnabled : const bool
This property holds true if the mobile data access point (APN) settings are enabled.
If the mobile data access point settings are enabled, then the user is able to change the access point name, protocol, authentication method, username, password, message center and message proxy for various mobile data connection contexts (internet, mms, etc).
If the mobile data access point settings are disabled, the user will be prevented from changing the settings, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | mobileDataAccessPointSettingsEnabled() const |
Notifier signal:
void | mobileDataAccessPointSettingsEnabledChanged() |
mobileNetworkSettingsEnabled : const bool
This property holds true if the mobile network settings are enabled.
If the mobile network settings are enabled, then the user is able to change, enable or disable the mobile network. If the mobile network settings are disabled, the user will be prevented from changing, enabling or disabling the mobile network, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | mobileNetworkSettingsEnabled() const |
Notifier signal:
void | mobileNetworkSettingsEnabledChanged() |
networkDataCounterSettingsEnabled : const bool
This property holds true if the network data counter policy is enabled.
If the network data counter policy is enabled, then the user is able to reset the network data counter statistics.
Access functions:
bool | networkDataCounterSettingsEnabled() const |
Notifier signal:
void | networkDataCounterSettingsEnabledChanged() |
networkProxySettingsEnabled : const bool
This property holds true if the network proxy settings are enabled.
If the network proxy settings are enabled, then the user is able to configure the proxy for each network service. If the network proxy settings are disabled, the user will be prevented from configuring the proxy for any of the network services, or from changing the global proxy configuration, thus the configuration set by the MDM application will be maintained.
Access functions:
bool | networkProxySettingsEnabled() const |
Notifier signal:
void | networkProxySettingsEnabledChanged() |
osUpdatesEnabled : const bool
This property holds true if OS updates are enabled.
If OS updates are enabled, the user can trigger OS updates via the Settings application UI. If they are disabled, the device will only be able to be updated by the MDM application.
Access functions:
bool | osUpdatesEnabled() const |
Notifier signal:
void | osUpdatesEnabledChanged() |
screenshotEnabled : const bool
This property holds true if the screenshot policy is enabled.
Access functions:
bool | screenshotEnabled() const |
Notifier signal:
void | screenshotEnabledChanged() |
sideLoadingSettingsEnabled : const bool
This property holds true if the side loading setting is enabled.
If the side loading setting is enabled, then the user is able to allow or disallow side loading. If side loading setting is disabled the configuration set by the MDM application will be maintained. Side loading controls whether user is allowed to install unsecure software packages that have not been downloaded from the secure application store.
Access functions:
bool | sideLoadingSettingsEnabled() const |
Notifier signal:
void | sideLoadingSettingsEnabledChanged() |
vpnConfigurationSettingsEnabled : const bool
This property holds true if the VPN manager settings policy is enabled.
If the VPN manager settings policy is enabled, then the user is able to create, remove and modify VPN configurations.
If the VPN manager settings policy is disabled, the user will be prevented from creating new, modifying or removing existing VPN configurations, thus the activation setting set by the MDM application will be maintained.
Because modifying a connection configuration could be used to disable it, the restrictions of this policy are also applied by the AccessPolicy::vpnConnectionSettingsEnabled policy, although the two polices can be set independently.
Access functions:
bool | vpnConfigurationSettingsEnabled() const |
Notifier signal:
void | vpnConfigurationSettingsEnabledChanged() |
vpnConnectionSettingsEnabled : const bool
This property holds true if the VPN connection settings policy is enabled.
If the VPN connection settings policy is enabled, then the user is able to activate and deactivate any individual VPN connection.
If the VPN connection settings policy is disabled, the user will be prevented from turning any of the VPN connections on or off, thus the activation setting set by the MDM application will be maintained.
Because modifying a connection configuration could be used to disable it, disabling the VPN connection settings policy will also prevent modification, creation or removal of VPN configurations. As such, although they can be set independently, the restrictions of this policy are a superset of the restrictions of the AccessPolicy::vpnConfigurationSettingsEnabled policy.
Access functions:
bool | vpnConnectionSettingsEnabled() const |
Notifier signal:
void | vpnConnectionSettingsEnabledChanged() |
wlanToggleEnabled : const bool
This property holds true if the WLAN toggle setting is enabled.
If the WLAN toggle setting is enabled, then the user is able to enable or disable the WLAN network. If the WLAN toggle setting is disabled, the user will be prevented from enabling or disabling the WLAN network, thus the configuration set by the MDM application will be maintained.
Per-network access policy is handled through ConnMan Manager and Service interface APIs.
Access functions:
bool | wlanToggleEnabled() const |
Notifier signal:
void | wlanToggleEnabledChanged() |
Member Function Documentation
AccessPolicy::AccessPolicy(QObject *parent = 0)
Default constructs an instance of AccessPolicy.
AccessPolicy::~AccessPolicy()
Destroys the instance of AccessPolicy.
bool AccessPolicy::setAccountCreationEnabled(bool enabled)
Sets the account setting policy to enabled. Returns true if the policy was successfully changed.
See also accountCreationEnabled().
bool AccessPolicy::setApplicationInstallationEnabled(bool enabled)
Sets the application installation policy to enabled. Returns true if the policy was successfully changed.
See also applicationInstallationEnabled().
bool AccessPolicy::setBluetoothToggleEnabled(bool enabled)
Sets the Bluetooth toggle setting policy to enabled. Returns true if the policy was successfully changed.
See also bluetoothToggleEnabled().
bool AccessPolicy::setBrowserEnabled(bool enabled)
Sets the web browser policy to enabled. Returns true if the policy was successfully changed.
See also browserEnabled().
bool AccessPolicy::setCallStatisticsSettingsEnabled(bool enabled)
Sets the call statistics policy to enabled. Returns true if the policy was successfully changed.
See also callStatisticsSettingsEnabled().
bool AccessPolicy::setCameraEnabled(bool enabled)
Sets the camera enablement policy to enabled. Returns true if the policy was successfully changed.
See also cameraEnabled().
bool AccessPolicy::setCellularTechnologySettingsEnabled(bool enabled)
Sets the cellular technology settings policy to enabled. Returns true if the policy was successfully changed.
See also cellularTechnologySettingsEnabled().
bool AccessPolicy::setDateTimeSettingsEnabled(bool enabled)
Sets the date/time settings enablement policy to enabled. Returns true if the policy was successfully changed.
See also dateTimeSettingsEnabled().
bool AccessPolicy::setDeveloperModeSettingsEnabled(bool enabled)
Sets the developer mode policy to enabled. Returns true if the policy was successfully changed.
See also developerModeSettingsEnabled().
bool AccessPolicy::setDeviceResetEnabled(bool enabled)
Sets the device reset enabled policy to enabled. Returns true if the policy was successfully changed.
See also deviceResetEnabled().
bool AccessPolicy::setFlightModeToggleEnabled(bool enabled)
Sets the Flight Mode toggle setting policy to enabled. Returns true if the policy was successfully changed.
In some jurisdictions it may be illegal to prevent the user from enabling flight mode, to prevent violating civil aviation laws. Please ensure that your application doesn't prevent the device or the user of the device from complying with all relevant laws and regulations, through its use of this API.
See also flightModeToggleEnabled().
bool AccessPolicy::setInternetSharingEnabled(bool enabled)
Sets the internet sharing setting policy to enabled. Returns true if the policy was successfully changed.
See also internetSharingEnabled().
bool AccessPolicy::setLocationSettingsEnabled(bool enabled)
Sets the location settings policy to enabled. Returns true if the policy was successfully changed.
See also locationSettingsEnabled().
bool AccessPolicy::setMicrophoneEnabled(bool enabled)
Sets the microphone policy to enabled. Returns true if the policy was successfully changed.
See also microphoneEnabled().
bool AccessPolicy::setMobileDataAccessPointSettingsEnabled(bool enabled)
Sets the mobile data access point settings policy to enabled. Returns true if the policy was successfully changed.
See also mobileDataAccessPointSettingsEnabled().
bool AccessPolicy::setMobileNetworkSettingsEnabled(bool enabled)
Sets the mobile network settings policy to enabled. Returns true if the policy was successfully changed.
See also mobileNetworkSettingsEnabled().
bool AccessPolicy::setNetworkDataCounterSettingsEnabled(bool enabled)
Sets the network data counter policy to enabled. Returns true if the policy was successfully changed.
See also networkDataCounterSettingsEnabled().
bool AccessPolicy::setNetworkProxySettingsEnabled(bool enabled)
Sets the network proxy settings policy to enabled. Returns true if the policy was successfully changed.
See also networkProxySettingsEnabled().
bool AccessPolicy::setOsUpdatesEnabled(bool enabled)
Sets the OS updates enablement policy to enabled. Returns true if the policy was successfully changed.
See also osUpdatesEnabled().
bool AccessPolicy::setScreenshotEnabled(bool enabled)
Sets the screenshot policy to enabled. Returns true if the policy was successfully changed.
See also screenshotEnabled().
bool AccessPolicy::setSideLoadingSettingsEnabled(bool enabled)
Sets the side loading policy to enabled. Returns true if the policy was successfully changed.
See also sideLoadingSettingsEnabled().
bool AccessPolicy::setVpnConfigurationSettingsEnabled(bool enabled)
Sets the VPN manager status policy to enabled. Returns true if the policy was successfully changed.
See also vpnConfigurationSettingsEnabled().
bool AccessPolicy::setVpnConnectionSettingsEnabled(bool enabled)
Sets the VPN connection status policy to enabled. Returns true if the policy was successfully changed.
See also vpnConnectionSettingsEnabled().
bool AccessPolicy::setWlanToggleEnabled(bool enabled)
Sets the WLAN toggle setting policy to enabled. Returns true if the policy was successfully changed.
See also wlanToggleEnabled().