Class PermissionRole
A Role within the permissions system.
Inherited Members
Namespace: Realms.Sync
Assembly: Realm.Sync.dll
Syntax
[MapTo("__Role")]
public class PermissionRole : RealmObject, INotifyPropertyChanged, ISchemaSource, IThreadConfined, NotificationsHelper.INotifiable
Remarks
A Role consists of a name for the role and a list of users which are members of the role. Roles are granted privileges on Realms, Classes and Objects, and in turn grant those privileges to all users which are members of the role.
A role named "everyone" is automatically created in new Realms, and all new users which connect to the Realm are automatically added to it. Any other roles you wish to use are managed as normal Realm objects.
Properties
| Improve this Doc View SourceName
Gets the name of the Role.
Declaration
[MapTo("name")]
[PrimaryKey]
[Required]
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Users
Gets the users which belong to the role.
Declaration
[MapTo("members")]
public IList<PermissionUser> Users { get; }
Property Value
Type | Description |
---|---|
IList<PermissionUser> |
Methods
| Improve this Doc View SourceGet(Realm, String)
Gets or creates a PermissionRole in the provided Realm.
Declaration
public static PermissionRole Get(Realm realm, string roleName)
Parameters
Type | Name | Description |
---|---|---|
Realm | realm | The Realm where the Role will be created. |
String | roleName | The name of the Role. |
Returns
Type | Description |
---|---|
PermissionRole | A PermissionRole instance that can be inspected or manipulated. |