struct UserScopedPermissionsControllerextension UserScopedPermissionsController : SendableA Controller class for interacting with user-scoped permissions.
-
Requests an offline access code from the authorization service, if configured with a server client ID.
Declaration
Swift
func requestOfflineAccess() async -> String?Return Value
The offline access code, or
nilif the request failed. -
Presents a view for users to update the permissions granted to the Home SDK.
Declaration
Swift
func presentPermissionsUpdate(structureID: String? = nil, allowedStructureIDs: [String]? = nil, allowStructureChange: Bool = false) asyncParameters
structureIDAn optional HGS ID of the structure to be pre-selected.
allowedStructureIDsAn optional list of HGS structure IDs to which the user’s choice should be restricted.
allowStructureChangeAn optional Boolean indicating whether the user is allowed to select a different structure. Defaults to false.
-
Returns a current access token and assertion for the current user.
Throws
HomeError.permissionDeniedDeclaration
Swift
func authorization() async throws -> (accessToken: String, assertion: Data)