Skip to content

User Grants

A User Grant represents the user's perspective of a Grant created by the owner through the Tapkey Web API. It provides detailed information about the user's access permissions.

The Tapkey Mobile SDK for iOS allows fetching a list of all Grants granted to the user. To retrieve a list of User Grants, you can obtain the TKMUserGrantManager through the TKMServiceFactory.

The TKMUserGrantManager fetches the User Grants live from the Tapkey Trust Service. Therefore, the application must be online for the operation to succeed. An application may consider caching this data for potential future use, should the mobile device become offline.

let userGrantManager = tapkeyServiceFactory.userManager

userGrantManager.fetchUserGrantsAsync(userId: userId, cancellationToken: cancellationToken)
    .continueOnUi {(userGrants: [UserGrant]) in
        // ToDo: Handle userGrants
    }
    .catchOnUi {(e: TKMAsyncException) in
        // ToDo: Add error handling
    }
    .conclude();