             self.showDeniedAlert(.Notifications)
         }
     }
+    
+    public func statusMicrophone() -> PermissionStatus {
+        let status = AVAudioSession.sharedInstance().recordPermission()
+        if status == .Granted {
+            return .Authorized
+        } else if status == .Denied {
+            return .Unauthorized
+        }
+        
+        return .Unknown
+    }
+    
+    func requestMicrophone() {
+        if statusMicrophone() == .Unknown {
+            AVAudioSession.sharedInstance().requestRecordPermission({ (granted) -> Void in
+                self.detectAndCallback()
+            })
+        } else if statusMicrophone() == .Unauthorized {
+            // TODO: Alert. User must go to Settings.
+            self.showDeniedAlert(.Microphone)
+        }
+    }
+    
+    public func statusCamera() -> PermissionStatus {
+        let status = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)
+        switch status {
+        case .Authorized:
+            return .Authorized
+        case .Restricted, .Denied:
+            return .Unauthorized
+        case .NotDetermined:
+            return .Unknown
+        }
+    }
+    
+    func requestCamera() {
+        if statusCamera() == .Unknown {
+            AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo,
+                completionHandler: { (granted) -> Void in
+                    self.detectAndCallback()
+            })
+        } else if statusCamera() == .Unauthorized {
+            // TODO: Alert. User must go to Settings.
+            self.showDeniedAlert(.Camera)
         }
     }
 

import UIKit
import CoreLocation
import AddressBook
//    case Microphone
//    case Camera
import AVFoundation

public enum PermissionType: String {

                status = statusContacts()
            case .Notifications:
                status = statusNotifications()
            case .Microphone:
                status = statusMicrophone();
            case .Camera:
                status = statusCamera()
            }

            let result = PermissionResult(type: config.type, status: status, demands: config.demands)
