Mac Developer Library

Developer

OpenDirectory Framework Reference ODRecord Class Reference

Options
Deployment Target:

On This Page
Language:

ODRecord

An ODRecord object serves as a Cocoa wrapper for an Open Directory record.

Inheritance


Conforms To


Import Statement


import OpenDirectory @import OpenDirectory;

Availability


Available in OS X v10.6 and later.
  • Changes the record’s password.

    Declaration

    Swift

    func changePassword(_ oldPassword: String!, toPassword newPassword: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)changePassword:(NSString *)oldPassword toPassword:(NSString *)newPassword error:(NSError **)outError

    Parameters

    oldPassword

    The record’s old password. Can be nil if the user has the proper permissions.

    newPassword

    The new password.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the password is successfully changed; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns a dictionary containing the password policy for the record.

    Declaration

    Objective-C

    - (NSDictionary *)passwordPolicyAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    The password policy for the record.

    Import Statement

    Availability

    Available in OS X v10.6 and later.

    Deprecated in OS X v10.9.

  • Sets credentials for the record’s node.

    Declaration

    Swift

    func setNodeCredentials(_ inUsername: String!, password inPassword: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setNodeCredentials:(NSString *)inUsername password:(NSString *)inPassword error:(NSError **)outError

    Parameters

    inUsername

    The username to use to authenticate with the node.

    inPassword

    The password to use to authenticate with the node.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the credentials are successfully set; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Sets the credentials for interaction with the record’s node using a Kerberos cache.

    Declaration

    Objective-C

    - (BOOL)setNodeCredentialsUsingKerberosCache:(NSString *)inCacheName error:(NSError **)outError

    Parameters

    inCacheName

    The name of the Kerberos cache.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the credentials are successfully set; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    Availability

    Available in OS X v10.6 and later.

    Deprecated in OS X v10.7.

  • Sets the credentials for interaction with the record’s node using other types of authentication available to Open Directory.

    Declaration

    Swift

    func setNodeCredentialsWithRecordType(_ inRecordType: String!, authenticationType inType: String!, authenticationItems inItems: [AnyObject]!, continueItems outItems: AutoreleasingUnsafeMutablePointer<NSArray?>, context outContext: AutoreleasingUnsafeMutablePointer<AnyObject?>, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setNodeCredentialsWithRecordType:(ODRecordType)inRecordType authenticationType:(ODAuthenticationType)inType authenticationItems:(NSArray *)inItems continueItems:(NSArray **)outItems context:(id *)outContext error:(NSError **)outError

    Parameters

    inRecordType

    The record type that uses the credentials. Can be nil. The default value is kODRecordTypeUsers.

    inType

    The authentication type.

    inItems

    An array of NSString or NSData objects to be used in the authentication process.

    outItems

    An array of NSData objects returned from the authentication process, if any are returned; nil otherwise.

    outContext

    The proper context if the authentication attempt requires a context; nil otherwise. If not nil, then more calls must be made with the Context to continue the authentication.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if no error occurs; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Verifies the credentials for interaction with the record’s node using other types of authentication available to Open Directory.

    Declaration

    Swift

    func verifyExtendedWithAuthenticationType(_ inType: String!, authenticationItems inItems: [AnyObject]!, continueItems outItems: AutoreleasingUnsafeMutablePointer<NSArray?>, context outContext: AutoreleasingUnsafeMutablePointer<AnyObject?>, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)verifyExtendedWithAuthenticationType:(ODAuthenticationType)inType authenticationItems:(NSArray *)inItems continueItems:(NSArray **)outItems context:(id *)outContext error:(NSError **)outError

    Parameters

    inType

    The authentication type.

    inItems

    An array of NSString or NSData objects to be used in the authentication process.

    outItems

    An array of NSData objects returned from the authentication process, if any are returned; nil otherwise.

    outContext

    The proper context if the authentication attempt requires a context; nil otherwise. If not nil, then more calls must be made with the Context to continue the authentication.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if verification succeeds; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Verifies the password for interaction with the record.

    Declaration

    Swift

    func verifyPassword(_ inPassword: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)verifyPassword:(NSString *)inPassword error:(NSError **)outError

    Parameters

    inPassword

    The password for authenticating with the record.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if verification succeeds; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Adds a member record to this group record.

    Declaration

    Swift

    func addMemberRecord(_ inRecord: ODRecord!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)addMemberRecord:(ODRecord *)inRecord error:(NSError **)outError

    Parameters

    inRecord

    The member record to add.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the member record is successfully added; otherwise, NOfalse.

    Discussion

    This method produces an error if this record is not a group record, or if inRecord is not an appropriate type.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Determines whether a given record is a member of this group record.

    Declaration

    Swift

    func isMemberRecord(_ inRecord: ODRecord!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)isMemberRecord:(ODRecord *)inRecord error:(NSError **)outError

    Parameters

    inRecord

    The record to test for membership.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if inRecord is a member of this group record; otherwise, NOfalse.

    Discussion

    If this record is not a group record, this method returns NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Removes a record as a member of this group record.

    Declaration

    Swift

    func removeMemberRecord(_ inRecord: ODRecord!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)removeMemberRecord:(ODRecord *)inRecord error:(NSError **)outError

    Parameters

    inRecord

    The member record.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if inRecord is successfully removed from this group record; otherwise, NOfalse.

    Discussion

    This method produces an error if this record is not a group record, or if inRecord is not an appropriate type.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Adds a value to an attribute of the record.

    Declaration

    Swift

    func addValue(_ inValue: AnyObject!, toAttribute inAttribute: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)addValue:(id)inValue toAttribute:(ODAttributeType)inAttribute error:(NSError **)outError

    Parameters

    inValue

    The value. Should be of type NSString or NSData.

    inAttribute

    The attribute.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the value is successfully added; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns a dictionary of attributes with their respective values.

    Declaration

    Swift

    func recordDetailsForAttributes(_ inAttributes: [AnyObject]!, error outError: NSErrorPointer) -> [NSObject : AnyObject]!

    Objective-C

    - (NSDictionary *)recordDetailsForAttributes:(NSArray *)inAttributes error:(NSError **)outError

    Parameters

    inAttributes

    An array of attributes. Can be nil.

    outError

    An error reference for error details. Can be nil.

    Return Value

    A dictionary of the attributes in inAttributes with their respective values.

    Discussion

    If inAttributes is nil, all currently retrieved attributes are returned.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • The official name of the record. (read-only)

    Declaration

    Swift

    var recordName: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *recordName

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • The record’s type. (read-only)

    Declaration

    Swift

    var recordType: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *recordType

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Removes all values from an attribute of the record.

    Declaration

    Swift

    func removeValuesForAttribute(_ inAttribute: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)removeValuesForAttribute:(ODAttributeType)inAttribute error:(NSError **)outError

    Parameters

    inAttribute

    The attribute.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the values are successfully removed; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Removes a value from an attribute of the record.

    Declaration

    Swift

    func removeValue(_ inValue: AnyObject!, fromAttribute inAttribute: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)removeValue:(id)inValue fromAttribute:(ODAttributeType)inAttribute error:(NSError **)outError

    Parameters

    inValue

    The value. Should be of type NSString or NSData.

    inAttribute

    The attribute.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the value is successfully removed; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Sets the values of an attribute of the record.

    Declaration

    Swift

    func setValue(_ inValueOrValues: AnyObject!, forAttribute inAttribute: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setValue:(id)inValueOrValues forAttribute:(ODAttributeType)inAttribute error:(NSError **)outError

    Parameters

    inValueOrValues

    The value or values. Can be of type NSString or NSData, or an NSArray with elements of both types.

    inAttribute

    The attribute.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the values are successfully set; otherwise, NOfalse.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Synchronizes the record from the directory to get current data and commit changes.

    Declaration

    Swift

    func synchronizeAndReturnError(_ outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)synchronizeAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the record successfully synchronizes; otherwise, NOfalse.

    Discussion

    This method only fetches those attributes that have been fetched before.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns the values of an attribute of the record.

    Declaration

    Swift

    func valuesForAttribute(_ inAttribute: String!, error outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    - (NSArray *)valuesForAttribute:(ODAttributeType)inAttribute error:(NSError **)outError

    Parameters

    inAttribute

    The attribute.

    outError

    An error reference for error details. Can be nil.

    Return Value

    An array of attribute values. Elements are of type NSString or NSData.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Deletes the record from its node and invalidates it.

    Declaration

    Swift

    func deleteRecordAndReturnError(_ outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)deleteRecordAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the record is successfully deleted; otherwise, NOfalse.

    Discussion

    The record should be released after this method is called.

    Import Statement

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.