---
title: "authorizationStatus(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkhealthstore/authorizationstatus(for:)"
---

# authorizationStatus(for:)

Returns the app’s authorization status for sharing the specified data type.

## Declaration

```swift
func authorizationStatus(for type: HKObjectType) -> HKAuthorizationStatus
```

## Parameters

- `type`: The type of data. This can be any concrete subclass of the doc://com.apple.healthkit/documentation/HealthKit/HKObjectType class (any of the doc://com.apple.healthkit/documentation/HealthKit/HKCharacteristicType , doc://com.apple.healthkit/documentation/HealthKit/HKQuantityType, doc://com.apple.healthkit/documentation/HealthKit/HKCategoryType, doc://com.apple.healthkit/documentation/HealthKit/HKWorkoutType or doc://com.apple.healthkit/documentation/HealthKit/HKCorrelationType classes).

## Mentioned in

Authorizing access to health data

## Return Value

Return Value A value indicating the app’s authorization status for this type. For a list of possible values, see HKAuthorizationStatus.

## Discussion

Discussion This method checks the authorization status for saving data to the HealthKit store. important: An app’s permissions don’t change when an app runs in a Guest User session. Therefore, authorizationStatus(for:) returns true if the owner previously granted authorization to write the data, even though the app can’t write it during a Guest User session. For more information, refer to Authorizing access to health data. To help prevent possible leaks of sensitive health information, your app cannot determine whether or not a user has granted permission to read data. If you are not given permission, it  simply appears as if there is no data of the requested type in the HealthKit store. If your app is given share permission but not read permission, you see only the data that your app has written to the store. Data from other sources remains hidden.

## See Also

### Accessing HealthKit

- [HKAuthorizationStatus](healthkit/hkauthorizationstatus.md)
- [getRequestStatusForAuthorization(toShare:read:completion:)](healthkit/hkhealthstore/getrequeststatusforauthorization(toshare:read:completion:).md)
- [HKAuthorizationRequestStatus](healthkit/hkauthorizationrequeststatus.md)
- [isHealthDataAvailable()](healthkit/hkhealthstore/ishealthdataavailable().md)
- [supportsHealthRecords()](healthkit/hkhealthstore/supportshealthrecords().md)
- [requestAuthorization(toShare:read:completion:)](healthkit/hkhealthstore/requestauthorization(toshare:read:completion:).md)
- [requestAuthorization(toShare:read:)](healthkit/hkhealthstore/requestauthorization(toshare:read:).md)
- [requestPerObjectReadAuthorization(for:predicate:completion:)](healthkit/hkhealthstore/requestperobjectreadauthorization(for:predicate:completion:).md)
- [handleAuthorizationForExtension(completion:)](healthkit/hkhealthstore/handleauthorizationforextension(completion:).md)
- [authorizationViewControllerPresenter](healthkit/hkhealthstore/authorizationviewcontrollerpresenter.md)
