Show / Hide Table of Contents

    Class PermissionChange

    Objects of this class allow to change permissions of owned Realms. They are created exclusively by the client and are processed by the server as indicated by the status fields.

    Inheritance
    Object
    RealmObject
    PermissionChange
    Inherited Members
    RealmObject.PropertyChanged
    RealmObject.IsManaged
    RealmObject.IsValid
    RealmObject.Realm
    RealmObject.ObjectSchema
    RealmObject.Equals(Object)
    RealmObject.RaisePropertyChanged(String)
    RealmObject.OnManaged()
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace:Realms.Sync
    Assembly:Realm.Sync.dll
    Syntax
    public class PermissionChange : RealmObject, INotifyPropertyChanged, ISchemaSource, IThreadConfined, NotificationsHelper.INotifiable, IPermissionObject, IStatusObject
    Remarks

    PermissionChange objects allow to grant and revoke permissions by setting MayRead, MayWrite and MayManage accordingly. If any of these flags are not set, these are merged with either the existing or default permissions as applicable. As a side-effect this causes that the default permissions are permanently materialized for the affected Realm files and the affected user. Once the request has been processed, the Status, StatusMessage, and ErrorCode will be updated accordingly.

    Properties

    | Improve this Doc View Source

    CreatedAt

    Gets the creation time of this object.

    Declaration
    [MapTo("createdAt")]
    public DateTimeOffset CreatedAt { get; }
    Property Value
    Type Description
    DateTimeOffset

    A DateTimeOffset indicating the object's creation date and time.

    Implements
    IPermissionObject.CreatedAt
    | Improve this Doc View Source

    ErrorCode

    Gets the ErrorCode if any.

    Declaration
    public ErrorCode? ErrorCode { get; }
    Property Value
    Type Description
    Nullable<ErrorCode>

    An ErrorCode that indicates the reason for the error during processing. null if no error has occurred or the object hasn't been processed yet.

    Implements
    IPermissionObject.ErrorCode
    Remarks

    Filled by the server after an object was processed indicating the status of the operation. If Status returns Error, the ErrorCode property can be used to get a strongly typed code for the error and handle expected error conditions, such as expired offer or attempting to share a realm without having manage access.

    | Improve this Doc View Source

    Id

    Gets the unique identifier of this object in the Management realm.

    Declaration
    [PrimaryKey]
    [Required]
    [MapTo("id")]
    public string Id { get; }
    Property Value
    Type Description
    String

    The unique id of the object.

    Implements
    IPermissionObject.Id
    | Improve this Doc View Source

    MayManage

    Gets a value indicating whether the user(s) have manage access to the specified Realm(s).

    Declaration
    [MapTo("mayManage")]
    public bool ? MayManage { get; }
    Property Value
    Type Description
    Nullable<Boolean>

    true or false to request this new value. null to keep current value.

    | Improve this Doc View Source

    MayRead

    Gets a value indicating whether the user(s) have read access to the specified Realm(s).

    Declaration
    [MapTo("mayRead")]
    public bool ? MayRead { get; }
    Property Value
    Type Description
    Nullable<Boolean>

    true or false to request this new value. null to keep current value.

    | Improve this Doc View Source

    MayWrite

    Gets a value indicating whether the user(s) have write access to the specified Realm(s).

    Declaration
    [MapTo("mayWrite")]
    public bool ? MayWrite { get; }
    Property Value
    Type Description
    Nullable<Boolean>

    true or false to request this new value. null to keep current value.

    | Improve this Doc View Source

    MetadataKey

    Gets the metadata key (if any) of the user(s) to effect.

    Declaration
    [MapTo("metadataKey")]
    public string MetadataKey { get; }
    Property Value
    Type Description
    String

    A metadata key or null if the change is not based on metadata values.

    | Improve this Doc View Source

    MetadataValue

    Gets the metadata value (if any) of the user(s) to effect.

    Declaration
    [MapTo("metadataValue")]
    public string MetadataValue { get; }
    Property Value
    Type Description
    String

    A value corresponding to MetadataKey or null if the change is not based on metadata values.

    | Improve this Doc View Source

    RealmUrl

    Gets the Realm to change permissions for.

    Declaration
    [Required]
    [MapTo("realmUrl")]
    public string RealmUrl { get; }
    Property Value
    Type Description
    String

    * to change the permissions of all Realms.

    | Improve this Doc View Source

    Status

    Gets the ManagementObjectStatus as set by the server.

    Declaration
    public ManagementObjectStatus Status { get; }
    Property Value
    Type Description
    ManagementObjectStatus

    An enum indicating whether the operation has completed successfully.

    Implements
    IPermissionObject.Status
    | Improve this Doc View Source

    StatusCode

    Declaration
    [MapTo("statusCode")]
    public int ? StatusCode { get; set; }
    Property Value
    Type Description
    Nullable<Int32>
    | Improve this Doc View Source

    StatusMessage

    Gets the status message.

    Declaration
    [MapTo("statusMessage")]
    public string StatusMessage { get; }
    Property Value
    Type Description
    String

    A detailed message describing the status (success, error) of the operation. null if the object has not been processed yet.

    Implements
    IPermissionObject.StatusMessage
    Remarks

    Filled by the server after an object was processed with additional info explaining the status if necessary.

    | Improve this Doc View Source

    UpdatedAt

    Gets when the object was updated the last time.

    Declaration
    [MapTo("updatedAt")]
    public DateTimeOffset UpdatedAt { get; }
    Property Value
    Type Description
    DateTimeOffset

    A DateTimeOffset indicating the last time the object has been updated.

    Implements
    IPermissionObject.UpdatedAt
    Remarks

    This will be updated by the server with the current object when the object is processed.

    | Improve this Doc View Source

    UserId

    Gets the user or users to effect.

    Declaration
    [Required]
    [MapTo("userId")]
    public string UserId { get; }
    Property Value
    Type Description
    String

    * to change the permissions for all users.

    Methods

    | Improve this Doc View Source

    OnPropertyChanged(String)

    Called when a property has changed on this class.

    Declaration
    protected override void OnPropertyChanged(string propertyName)
    Parameters
    Type Name Description
    String propertyName

    The name of the property.

    Overrides
    RealmObject.OnPropertyChanged(String)
    Remarks

    For this method to be called, you need to have first subscribed to PropertyChanged. This can be used to react to changes to the current object, e.g. raising PropertyChanged for computed properties.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2017 Realm
    Generated by DocFX