Permission

@objc(RealmSwiftPermission)
public class Permission : Object

A permission which can be applied to a Realm, Class, or specific Object.

Permissions are applied by adding the permission to the RealmPermission singleton object, the ClassPermission object for the desired class, or to a user-defined List property on a specific Object instance. The meaning of each of the properties of Permission depend on what the permission is applied to, and so are left undocumented here. See RealmPrivileges, ClassPrivileges, and ObjectPrivileges for details about what each of the properties mean when applied to that type.

  • The Role which this Permission applies to. All users within the Role are granted the permissions specified by the fields below any objects/classes/realms which use this Permission.

    This property cannot be modified once set.

    Declaration

    Swift

    @objc
    dynamic public var role: PermissionRole?
  • Whether the user can read the object to which this Permission is attached.

    Declaration

    Swift

    @objc
    dynamic public var canRead: Bool
  • Whether the user can modify the object to which this Permission is attached.

    Declaration

    Swift

    @objc
    dynamic public var canUpdate: Bool
  • Whether the user can delete the object to which this Permission is attached.

    This field is only applicable to Permissions attached to Objects, and not to Realms or Classes.

    Declaration

    Swift

    @objc
    dynamic public var canDelete: Bool
  • Whether the user can add or modify Permissions for the object which this Permission is attached to.

    Declaration

    Swift

    @objc
    dynamic public var canSetPermissions: Bool
  • Whether the user can subscribe to queries for this object type.

    This field is only applicable to Permissions attached to Classes, and not to Realms or Objects.

    Declaration

    Swift

    @objc
    dynamic public var canQuery: Bool
  • Whether the user can create new objects of the type this Permission is attached to.

    This field is only applicable to Permissions attached to Classes, and not to Realms or Objects.

    Declaration

    Swift

    @objc
    dynamic public var canCreate: Bool
  • Whether the user can modify the schema of the Realm which this Permission is attached to.

    This field is only applicable to Permissions attached to Realms, and not to Realms or Objects.

    Declaration

    Swift

    @objc
    dynamic public var canModifySchema: Bool