Class MappedRole
Map one role to several roles in the system. roles : Comma separated list of roles. E.g, WebAdmins, WebEditors mode : Any or All, Default is Any. If Any is set the principal only has to be a member of one of the roles specifed.
Inherited Members
Namespace: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 10.10.4Syntax
public class MappedRole : VirtualRoleProviderBase
Constructors
MappedRole()
Creates a new instance of MappedRole
Declaration
public MappedRole()
MappedRole(IVirtualRoleRepository)
Creates a new instance of MappedRole
Declaration
public MappedRole(IVirtualRoleRepository repository)
Parameters
Type | Name | Description |
---|---|---|
IVirtualRoleRepository | repository |
MappedRole(VirtualRoleRepository<VirtualRoleProviderBase>)
Declaration
[Obsolete("Use alternative constructor")]
public MappedRole(VirtualRoleRepository<VirtualRoleProviderBase> repository)
Parameters
Type | Name | Description |
---|---|---|
VirtualRoleRepository<VirtualRoleProviderBase> | repository |
Properties
Roles
A list of roles this role is mapped to.
Declaration
public IEnumerable<string> Roles { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
ShouldMatchAll
Specifies if all mapped roles must match to be considered part of this role
Declaration
public bool ShouldMatchAll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Initialize(String, NameValueCollection)
Initializes the provider.
Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The friendly name of the provider. |
System.Collections.Specialized.NameValueCollection | config | A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The name of the provider is null. |
System.ArgumentException | The name of the provider has a length of zero. |
System.InvalidOperationException | An attempt is made to call System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection) on a provider after the provider has already been initialized. |
IsInVirtualRole(IPrincipal, Object)
Determines whether the specified principal is a member of the roles specified.
Declaration
public override bool IsInVirtualRole(IPrincipal principal, object context)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | principal | The principal. |
System.Object | context | External context. |
Returns
Type | Description |
---|---|
System.Boolean |
|