Class PermissionCondition
A class describing the condition based on which permissions will be applied.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public abstract class PermissionCondition
Properties
| Improve this Doc View SourceDefault
Gets a PermissionCondition that describes the default permissions for all users who don't have explicit permissions applied. The AccessLevel granted alongside this condition will also be used as default access level for future new users.
Declaration
public static PermissionCondition Default { get; }
Property Value
Type | Description |
---|---|
PermissionCondition | A PermissionCondition describing the default permissions. |
Remarks
The default permissions are not additive with more specific permissions, even if the latter are more restrictive - for example, a user who has been granted Read access will not be write to a Realm, even if the default permissions grant Write access.
Methods
| Improve this Doc View SourceEmail(String)
Apply permissions based on the user's Email when using the username/password login provider.
Declaration
public static PermissionCondition Email(string email)
Parameters
Type | Name | Description |
---|---|---|
String | The email (username) of the user that will be affected by this condition. |
Returns
Type | Description |
---|---|
PermissionCondition | A PermissionCondition containing information about the user's email. |
KeyValue(String, String)
Apply permissions based on a key/value combination in the user's metadata.
Declaration
public static PermissionCondition KeyValue(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The metadata key to look for. |
String | value | The metadata value that must match the key. |
Returns
Type | Description |
---|---|
PermissionCondition | A PermissionCondition containing information about the key/value combination that will be used for matching against. |
UserId(String)
Apply permissions based on the user's Id.
Declaration
public static PermissionCondition UserId(string userId)
Parameters
Type | Name | Description |
---|---|---|
String | userId | The Id of the user. |
Returns
Type | Description |
---|---|
PermissionCondition | A PermissionCondition containing information about the user's Id. |