FRAPolicyEvaluator

public class FRAPolicyEvaluator

The Policy Evaluator is used by the SDK to enforce Policy rules, such as Device Tampering Policy. It consist of one or more FRAPolicy objects. Each Policy contain instructions that determine whether it comply to a particular condition at a particular time.

Properties

  • The list of polices to be evaluated.

    Declaration

    Swift

    public internal(set) var policies: [FRAPolicy]? { get }

Init

  • Initializes FRAPolicyEvaluator object

    Declaration

    Swift

    public init()

Result

  • Result of the Policy Evaluator execution.

    See more

    Declaration

    Swift

    public struct Result

Policy Evaluator

  • Registers a new array of policies; the new array can override the existing policies, or append on top of existing array. This method does not check if a policy has been added to the list previously.

    Throws

    FRAError

    Declaration

    Swift

    public func registerPolicies(policies: [FRAPolicy], shouldOverride: Bool = true) throws

    Parameters

    policies

    An array of FRAPolicy to be registered

    shouldOverride

    Boolean indicator whether or not to override existing array

  • Evaluate all registered Policies against an URI.

    Declaration

    Swift

    public func evaluate(uri: URL) -> Result

    Parameters

    uri

    URL of QR Code

  • Evaluate all registered Policies against an URI.

    Declaration

    Swift

    public func evaluate(account: Account) -> Result

    Parameters

    account

    Account object

  • Return if a policy was attached to the Account.

    Declaration

    Swift

    public func isPolicyAttached(account: Account, policyName: String) -> Bool

    Parameters

    account

    Account object

    policyName

    The name of the policy

    Return Value

    true, if the policy was attached to the Account, false otherwise.