RLMSyncPermissionValue

@interface RLMSyncPermissionValue : NSObject

A value representing a permission granted to the specified user(s) to access the specified Realm(s).

RLMSyncPermissionValue is immutable and can be accessed from any thread.

See https://realm.io/docs/realm-object-server/#permissions for general documentation.

  • The Realm Object Server path to the Realm to which this permission applies (e.g. /path/to/realm).

    Specify * if this permission applies to all Realms managed by the server.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull path;

    Swift

    var path: String { get }
  • The access level described by this permission.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMSyncAccessLevel accessLevel;

    Swift

    var accessLevel: RLMSyncAccessLevel { get }
  • Whether the access level allows the user to read from the Realm.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL mayRead;

    Swift

    var mayRead: Bool { get }
  • Whether the access level allows the user to write to the Realm.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL mayWrite;

    Swift

    var mayWrite: Bool { get }
  • Whether the access level allows the user to administer the Realm.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL mayManage;

    Swift

    var mayManage: Bool { get }
  • Create a new sync permission value, for use with permission APIs.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithRealmPath:(nonnull NSString *)path
                                       userID:(nonnull NSString *)userID
                                  accessLevel:(RLMSyncAccessLevel)accessLevel;

    Swift

    init(realmPath path: String, userID: String, accessLevel: RLMSyncAccessLevel)

    Parameters

    path

    The Realm Object Server path to the Realm whose permission should be modified (e.g. /path/to/realm). Pass * to apply to all Realms managed by the server.

    userID

    The identity of the user who should be granted access to the Realm at path. Pass * to apply to all users managed by the server.

    accessLevel

    The access level to grant.

  • The identity of the user to whom this permission is granted, or * if all users are granted this permission.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *userId;

    Swift

    var userId: String? { get }
  • When this permission object was last updated.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDate *_Nonnull updatedAt;

    Swift

    var updatedAt: Date { get }