     }
 
     func dependencyForOperation(operation: Operation) -> NSOperation? {
-        return LocationPermissionOperation(usage: usage)
+        return LocationPermissionOperation(usage: usage, manager: manager)
     }
 
     func evaluateForOperation(operation: Operation, completion: OperationConditionResult -> Void) {
+        let enabled = manager.dynamicType.locationServicesEnabled()
+        let actual = manager.dynamicType.authorizationStatus()
 
+        switch (enabled, usage, actual) {
+
+        case (true, _, .AuthorizedAlways), (true, .WhenInUse, .AuthorizedWhenInUse):
+            // Service is enabled with always authorization, or we
+            // require when in use, and it's authorized when in use.
+            completion(.Satisfied)
+
+        case (false, _, _):
+            completion(.Failed(Error.LocationServicesNotEnabled))
+
+        default:
+            completion(.Failed(Error.AuthenticationStatusNotSufficient(actual, usage)))
+        }
+    }
+}
+
+extension LocationCondition.LocationPermissionOperation: CLLocationManagerDelegate {
+
+    @objc func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
+        if executing && status != CLAuthorizationStatus.NotDetermined {
+            if self.manager.isKindOfClass(CLLocationManager) && (self.manager as! CLLocationManager) == manager {
+                finish()
+            }
+            else if !self.manager.isKindOfClass(CLLocationManager) {
+                finish()
+            }
+        }
     }
 }
 
 
-


    enum Usage: Int { case WhenInUse = 1, Always }

    private class LocationPermissionOperation: Operation {
        let usage: Usage

        init(usage: Usage) {
            self.usage = usage
            super.init()

        }
    }


import Foundation
import CoreLocation

internal protocol LocationManager: NSObjectProtocol {

    static func locationServicesEnabled() -> Bool
    static func authorizationStatus() -> CLAuthorizationStatus

    weak var delegate: CLLocationManagerDelegate? { get set }
}

extension CLLocationManager: LocationManager { }
