RLMClassPrivileges

struct RLMClassPrivileges {}

A description of the actual privileges which apply to a Class within a Realm.

This is a combination of all of the privileges granted to all of the Roles which the current User is a member of, obtained by calling -[RLMRealm privilegesForClass:] or -[RLMRealm privilegesForClassNamed:] on the Realm.

By default, all operations are permitted, and each privilege field indicates an operation which may be forbidden.

  • If false, the current User is not permitted to see objects of this type, and attempting to query this class will always return empty results.

    Note that Read permissions are transitive, and so it may be possible to read an
    object which the user does not directly have Read permissions for by following a
    link to it from an object they do have Read permissions for. This does not apply
    to any of the other permission types.
    

    Declaration

    Objective-C

    _Bool read : 1

    Swift

    var read: Bool { get set }
  • If false, creating new objects of this type is not permitted. Write transactions creating objects can be performed locally, but the objects will be deleted by the server when synchronization occurs.

    For objects with Primary Keys, it may not be locally determinable if Create or
    Update privileges are applicable. It may appear that you are creating a new object,
    but an object with that Primary Key may already exist and simply not be visible to
    you, in which case it is actually an Update operation.
    

    Declaration

    Objective-C

    _Bool create : 1

    Swift

    var create: Bool { get set }
  • If false, no modifications to objects of this type are permitted. Write transactions modifying the objects can be performed locally, but any changes made will be reverted by the server.

    Deleting an object is considered a modification, and is governed by this privilege.
    

    Declaration

    Objective-C

    _Bool update : 1

    Swift

    var update: Bool { get set }
  • If false, the User is not permitted to create new subscriptions for this class. Local queries against the objects within the Realm will work, but new subscriptions will never add objects to the Realm.

    Declaration

    Objective-C

    _Bool subscribe : 1

    Swift

    var subscribe: Bool { get set }
  • If false, no modifications to the permissions property of the RLMClassPermissions object for this type are permitted. Write transactions can be performed locally, but any changes made will be reverted by the server.

    Note that if invalid privilege changes are made, `-[RLMRealm privilegesFor*:]`
    will return results reflecting those invalid changes until synchronization occurs.
    
    Even if this field is `true`, note that the user will be unable to grant
    privileges to a Role which they do not themselves have.
    

    Declaration

    Objective-C

    _Bool setPermissions : 1

    Swift

    var setPermissions: Bool { get set }