Class ReadOnlyUserGroup
Represents a read-only implementation of a user group providing basic information.
Inheritance
Namespace: Umbraco.Cms.Core.Models.Membership
Assembly: Umbraco.Core.dll
Syntax
public class ReadOnlyUserGroup : IReadOnlyUserGroup
Constructors
View SourceReadOnlyUserGroup(int, Guid, string?, string?, int?, int?, string?, IEnumerable<int>, IEnumerable<string>, ISet<string>, ISet<IGranularPermission>, bool)
Initializes a new instance of the ReadOnlyUserGroup class.
Declaration
[Obsolete("Please use the constructor that includes all parameters. Scheduled for removal in Umbraco 19.")]
public ReadOnlyUserGroup(int id, Guid key, string? name, string? icon, int? startContentId, int? startMediaId, string? alias, IEnumerable<int> allowedLanguages, IEnumerable<string> allowedSections, ISet<string> permissions, ISet<IGranularPermission> granularPermissions, bool hasAccessToAllLanguages)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The unique identifier for the user group. |
| Guid | key | The unique key for the user group. |
| string | name | The name of the user group. |
| string | icon | The icon for the user group. |
| int? | startContentId | The starting content node identifier. |
| int? | startMediaId | The starting media node identifier. |
| string | alias | The alias of the user group. |
| IEnumerable<int> | allowedLanguages | The collection of allowed language identifiers. |
| IEnumerable<string> | allowedSections | The collection of allowed section aliases. |
| ISet<string> | permissions | The set of permissions. |
| ISet<IGranularPermission> | granularPermissions | The set of granular permissions. |
| bool | hasAccessToAllLanguages | Indicates whether the group has access to all languages. |
ReadOnlyUserGroup(int, Guid, string?, string?, string?, int?, int?, string?, IEnumerable<int>, IEnumerable<string>, ISet<string>, ISet<IGranularPermission>, bool)
Initializes a new instance of the ReadOnlyUserGroup class.
Declaration
public ReadOnlyUserGroup(int id, Guid key, string? name, string? description, string? icon, int? startContentId, int? startMediaId, string? alias, IEnumerable<int> allowedLanguages, IEnumerable<string> allowedSections, ISet<string> permissions, ISet<IGranularPermission> granularPermissions, bool hasAccessToAllLanguages)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The unique identifier for the user group. |
| Guid | key | The unique key for the user group. |
| string | name | The name of the user group. |
| string | description | The description of the user group. |
| string | icon | The icon for the user group. |
| int? | startContentId | The starting content node identifier. |
| int? | startMediaId | The starting media node identifier. |
| string | alias | The alias of the user group. |
| IEnumerable<int> | allowedLanguages | The collection of allowed language identifiers. |
| IEnumerable<string> | allowedSections | The collection of allowed section aliases. |
| ISet<string> | permissions | The set of permissions. |
| ISet<IGranularPermission> | granularPermissions | The set of granular permissions. |
| bool | hasAccessToAllLanguages | Indicates whether the group has access to all languages. |
Properties
View SourceAlias
Gets the alias of the user group.
Declaration
public string Alias { get; }
Property Value
| Type | Description |
|---|---|
| string |
AllowedLanguages
Gets the collection of language identifiers that this user group has access to.
Declaration
public IEnumerable<int> AllowedLanguages { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<int> |
AllowedSections
Gets the collection of section aliases that this user group has access to.
Declaration
public IEnumerable<string> AllowedSections { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Description
Gets the description of the user group.
Declaration
public string? Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
TODO (V18): Remove the default implementations.
GranularPermissions
Gets the set of granular permissions assigned to this user group.
Declaration
public ISet<IGranularPermission> GranularPermissions { get; }
Property Value
| Type | Description |
|---|---|
| ISet<IGranularPermission> |
HasAccessToAllLanguages
Gets a value indicating whether this user group has access to all languages.
Declaration
public bool HasAccessToAllLanguages { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This is set to return true as default to avoid breaking changes.
Icon
Gets the icon for the user group.
Declaration
public string? Icon { get; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Gets the unique identifier for the user group.
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
Key
Gets the unique key for the user group.
Declaration
public Guid Key { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Name
Gets the name of the user group.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Permissions
Gets the set of permissions assigned to this user group.
Declaration
public ISet<string> Permissions { get; }
Property Value
| Type | Description |
|---|---|
| ISet<string> |
StartContentId
Gets the starting content node identifier for this user group.
Declaration
public int? StartContentId { get; }
Property Value
| Type | Description |
|---|---|
| int? |
StartMediaId
Gets the starting media node identifier for this user group.
Declaration
public int? StartMediaId { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Methods
View SourceEquals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Equals(ReadOnlyUserGroup?)
Declaration
public bool Equals(ReadOnlyUserGroup? other)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyUserGroup | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Operators
View Sourceoperator ==(ReadOnlyUserGroup, ReadOnlyUserGroup)
Determines whether two ReadOnlyUserGroup instances are equal.
Declaration
public static bool operator ==(ReadOnlyUserGroup left, ReadOnlyUserGroup right)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyUserGroup | left | The first instance to compare. |
| ReadOnlyUserGroup | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(ReadOnlyUserGroup, ReadOnlyUserGroup)
Determines whether two ReadOnlyUserGroup instances are not equal.
Declaration
public static bool operator !=(ReadOnlyUserGroup left, ReadOnlyUserGroup right)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyUserGroup | left | The first instance to compare. |
| ReadOnlyUserGroup | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|