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 user.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.
-
Create a new sync permission value, for use with permission APIs.
Declaration
Objective-C
- (nonnull instancetype)initWithRealmPath:(nonnull NSString *)path username:(nonnull NSString *)username accessLevel:(RLMSyncAccessLevel)accessLevel;
Swift
init(realmPath path: String, username: 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 user.username
The username (often an email address) of the user who should be granted access to the Realm at
path
.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. Nil if the permission is defined in terms of a key-value pair.Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *userId;
Swift
var userId: String? { get }
-
If the permission is defined in terms of a key-value pair, the key describing the type of criterion used to determine what users the permission applies to. Otherwise, nil.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *key;
Swift
var key: String? { get }
-
If the permission is defined in terms of a key-value pair, a string describing the criterion value used to determine what users the permission applies to. Otherwise, nil.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) NSString *value;
Swift
var value: String? { get }
-
When this permission object was last updated.
Declaration
Objective-C
@property (readonly, nonatomic) NSDate *_Nonnull updatedAt;
Swift
var updatedAt: Date { get }