RealmPrivileges

public struct RealmPrivileges : OptionSet, CustomDebugStringConvertible

A description of the actual privileges which apply to 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 realm.getPrivileges().

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

  • Declaration

    Swift

    public let rawValue: UInt8
  • Declaration

    Swift

    public init(rawValue: RawValue)
  • If false, the current User is not permitted to see the Realm at all. This can happen only if the Realm was created locally and has not yet been synchronized.

    Declaration

    Swift

    public static let read: RealmPrivileges
  • If false, no modifications to the Realm are permitted. Write transactions can be performed locally, but any changes made will be reverted by the server. setPermissions and modifySchema will always be false when this is false.

    Declaration

    Swift

    public static let update: RealmPrivileges
  • If false, no modifications to the permissions property of the RLMRealmPermissions object for are permitted. Write transactions can be performed locally, but any changes made will be reverted by the server.

    Note that if invalide 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.

    Adding or removing Users from a Role is controlled by Update privileges on that Role, and not by this value.

    Declaration

    Swift

    public static let setPermissions: RealmPrivileges
  • If false, the user is not permitted to add new object types to the Realm or add new properties to existing objec types. Defining new RLMObject subclasses (and not excluding them from the schema with -[RLMRealmConfiguration setObjectClasses:]) will result in the application crashing if the object types are not first added on the server by a more privileged user.

    Declaration

    Swift

    public static let modifySchema: RealmPrivileges