SAPcpmsSecurityPolicyApplyStep
open class SAPcpmsSecurityPolicyApplyStep : OnboardingStep
Instantiates an OnboardingStep that uses the downloaded SAPcpmsSettings to determine the security policies set from Mobile Services and applies them.
There are four types of security policies that we read and act upon in this step:
DeviceComplianceDetectionPolicyClipboardAccessPolicyPrintPolicyOpenURLPolicy
SAPcpmsSecurityPolicyApplyStep performs the following actions during an onboard, restore, and passcode reset.
- If
DeviceComplianceDetectionPolicyis set toreport: Performs a detection check and uploads the compliance status to Mobile Services. - If
DeviceComplianceDetectionPolicyis set toignore: Does not perform a detection check or upload any compliance status to Mobile Services. - If unable to determine
DeviceComplianceDetectionPolicy: Does not perform a detection check or upload any compliance status to Mobile Services. - If
ClipboardAccessPolicyis set toblocked:ClipboardProtectionEnforcerprevents cut, copy, and paste actions between this app and any other app. - If
ClipboardAccessPolicyis set tounrestricted:ClipboardProtectionEnforcerdoes not prevent cut, copy, and paste actions between this app and other apps. - If unable to determine
ClipboardAccessPolicy:ClipboardProtectionEnforcerdoes not intervene with the default app’s behavior. - If
PrintPolicyis set toblocked:PrintPolicyEnforcerprevents the printing of an app’s content. - If
OpenURLPolicyis set toblocked:OpenURLPolicyEnforcerprevents the opening of URLs in external applications. - If
PrintPolicyandOpenURLPolicyare set tounrestricted: APIs for print and opening URLs are restored.
Precondition
SAPcpmsSecurityPolicyApplyStep needs to run anytime after SAPcpmsSettingsDownloadStep. SAPcpmsSettingsDownloadStep, usually used indirectly through SAPcpmsDefaultSteps.settingsDownload, will obtain the required policy information.
Note
SAPcpmsSecurityPolicyApplyStep will return OnboardingResult.success even if the compliance status upload fails due to a lack of network connectivity.
Usage
public var onboardingSteps: [OnboardingStep] {
return [
// ...
CompositeStep(steps: SAPcpmsDefaultSteps.settingsDownload),
CompositeStep(steps: SAPcpmsDefaultSteps.applyDuringOnboard),
SAPcpmsSecurityPolicyApplyStep(),
// ...
]
}
-
Default initializer for
SAPcpmsSecurityPolicyApplyStep.Declaration
Swift
public init() -
Onboarding function with
OnboardingContextsupportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Restore function with
OnboardingContextsupportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Reset function with
OnboardingContextsupportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void) -
ResetPasscode function with
OnboardingContextsupportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject that contains all of the information for theOnboardingStep.