Class PermissionOffer
Objects of this class are used to offer permissions to owned Realms. They are created exclusively by the client and are processed by the server as indicated by the status fields.
Inherited Members
Namespace:Realms.Sync
Assembly:Realm.Sync.dll
Syntax
public class PermissionOffer : RealmObject, IReflectableType, INotifyPropertyChanged, ISchemaSource, IPermissionObject
Remarks
When offering permissions, you should create the offer and add it to the User's Management Realm. Then you should subscribe to PropertyChanged to be notified when the server has processed the request. Once the request has been processed, the Status, StatusMessage, and ErrorCode will be updated accordingly. If the request has been processed successfully, the Token will be populated and you can share it with users you wish to grant permissions to. If the request has failed, the StatusMessage will be updated with relevant information about the failure and ErrorCode will be set to a non-null value.
Constructors
| Improve this Doc View SourcePermissionOffer(String, Boolean, Boolean, Boolean, Nullable<DateTimeOffset>)
Initializes a new instance of the PermissionOffer class.
Declaration
public PermissionOffer(string realmUrl, bool mayRead = true, bool mayWrite = false, bool mayManage = false, DateTimeOffset? expiresAt = null)
Parameters
Type | Name | Description |
---|---|---|
String | realmUrl | The Realm URL to offer permissions to. |
Boolean | mayRead | If set to |
Boolean | mayWrite | If set to |
Boolean | mayManage | If set to |
Nullable<DateTimeOffset> | expiresAt | Optional expiration date of the offer. If set to |
Properties
| Improve this Doc View SourceCreatedAt
Declaration
[MapTo("createdAt")]
public DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Implements
| Improve this Doc View SourceErrorCode
Declaration
public ErrorCode? ErrorCode { get; }
Property Value
Type | Description |
---|---|
Nullable<ErrorCode> |
Implements
| Improve this Doc View SourceExpiresAt
Gets or sets the expiration date and time of the offer.
Declaration
[MapTo("expiresAt")]
public DateTimeOffset? ExpiresAt { get; set; }
Property Value
Type | Description |
---|---|
Nullable<DateTimeOffset> | If |
Id
Declaration
[PrimaryKey]
[Required]
[MapTo("id")]
public string Id { get; }
Property Value
Type | Description |
---|---|
String |
Implements
| Improve this Doc View SourceMayManage
Gets a value indicating whether the receiver of this offer will be able to manage access rights for others.
Declaration
[MapTo("mayManage")]
public bool MayManage { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
MayRead
Gets a value indicating whether the receiver of this offer will be able to read from the Realm.
Declaration
[MapTo("mayRead")]
public bool MayRead { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
MayWrite
Gets a value indicating whether the receiver of this offer will be able to write to the Realm.
Declaration
[MapTo("mayWrite")]
public bool MayWrite { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
RealmUrl
Gets the url of the Realm to offer permissions to.
Declaration
[MapTo("realmUrl")]
[Required]
public string RealmUrl { get; }
Property Value
Type | Description |
---|---|
String |
Status
Declaration
public ManagementObjectStatus Status { get; }
Property Value
Type | Description |
---|---|
ManagementObjectStatus |
Implements
| Improve this Doc View SourceStatusMessage
Declaration
[MapTo("statusMessage")]
public string StatusMessage { get; }
Property Value
Type | Description |
---|---|
String |
Implements
| Improve this Doc View SourceToken
Gets the token that can be used to offer the permissions defined in this object to another user.
Declaration
[MapTo("token")]
[Indexed]
public string Token { get; }
Property Value
Type | Description |
---|---|
String | A string, set by the server, that can be used to create a PermissionOfferResponse. |
UpdatedAt
Declaration
[MapTo("updatedAt")]
public DateTimeOffset UpdatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Implements
Methods
| Improve this Doc View SourceOnPropertyChanged(String)
Declaration
protected override void OnPropertyChanged(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName |