---
title: SFAuthorization
framework: securityfoundation
role: symbol
role_heading: Class
path: securityfoundation/sfauthorization
---

# SFAuthorization

A class that allows you to restrict a user’s access to particular features in your Mac app or daemon.

## Declaration

```swift
class SFAuthorization
```

## Overview

Overview important: The authorization services API is not supported within an app sandbox because it allows privilege escalation. The SFAuthorization class is an interface for some of the functions in the Authorization Services API. You can use the authorizationRef() method to obtain an authorization reference, used in other calls to Authorization Services functions. The Authorization Services API is documented in Authorization Services.

## Topics

### Allocating and initializing an authorization object

- [authorization()](securityfoundation/sfauthorization/authorization().md)
- [authorization(with:rights:environment:)](securityfoundation/sfauthorization/authorization(with:rights:environment:).md)
- [init()](securityfoundation/sfauthorization/init().md)
- [init(flags:rights:environment:)](securityfoundation/sfauthorization/init(flags:rights:environment:).md)

### Obtaining an authorization reference

- [authorizationRef()](securityfoundation/sfauthorization/authorizationref().md)

### Authorizing rights

- [obtain(withRights:flags:environment:authorizedRights:)](securityfoundation/sfauthorization/obtain(withrights:flags:environment:authorizedrights:).md)
- [obtain(withRight:flags:)](securityfoundation/sfauthorization/obtain(withright:flags:).md)

### Preventing credentials from being shared

- [invalidateCredentials()](securityfoundation/sfauthorization/invalidatecredentials().md)

### Initializers

- [init(coder:)](securityfoundation/sfauthorization/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
