<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GSS",
  "identifier" : "/documentation/GSS/gss_userok(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@gss_userok"
  },
  "title" : "gss_userok(_:_:)"
}
-->

# gss_userok(_:_:)

Returns a flag that indicates if a given user is authorized.

```
func gss_userok(_ name: gss_name_t, _ user: UnsafePointer<CChar>) -> Int32
```

## Parameters

`name`

A name object.

`user`

A C string that is first imported as a name object with name type [`GSS_C_NT_USER_NAME`](/documentation/GSS/GSS_C_NT_USER_NAME) and then authorized against the name object given by the first parameter.

## Return Value

A non-zero integer when the user is authorized and zero otherwise.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)