World is now on Opti ID! Learn more

Class UIRoleProvider

Manages roles for the users.

Inheritance
System.Object
UIRoleProvider
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Security
Assembly: EPiServer.Shell.dll
Version: 10.10.4
Syntax
public abstract class UIRoleProvider : IDisposable

Constructors

UIRoleProvider()

Declaration
protected UIRoleProvider()

Properties

Enabled

Gets or sets a value indicating whether role management is enabled.

Declaration
public abstract bool Enabled { get; set; }
Property Value
Type Description
System.Boolean

Name

get the name of provider

Declaration
public abstract string Name { get; }
Property Value
Type Description
System.String

Methods

AddUserToRoles(String, IEnumerable<String>)

Adds the specified user to the specified roles.

Declaration
public abstract void AddUserToRoles(string username, IEnumerable<string> roleNames)
Parameters
Type Name Description
System.String username

The user name

System.Collections.Generic.IEnumerable<System.String> roleNames

The role name

CreateRole(String)

Creates a new role.

Declaration
public abstract void CreateRole(string newRoleName)
Parameters
Type Name Description
System.String newRoleName

The role name

DeleteRole(String, Boolean)

Removes a role.

Declaration
public abstract bool DeleteRole(string roleName, bool throwOnPopulatedRole)
Parameters
Type Name Description
System.String roleName

The role name

System.Boolean throwOnPopulatedRole

If true, throw an exception if roleName has one or more members and do not delete roleName.

Returns
Type Description
System.Boolean

true if the role was successfully deleted; otherwise, false.

DeleteRole(String, String, Boolean)

Removes a role.

Declaration
public virtual bool DeleteRole(string providerName, string roleName, bool throwOnPopulatedRole)
Parameters
Type Name Description
System.String providerName

The provider name

System.String roleName

the role name

System.Boolean throwOnPopulatedRole

If true, throw an exception if roleName has one or more members and do not delete roleName.

Returns
Type Description
System.Boolean

true if the role was successfully deleted; otherwise, false.

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

disposes the provider

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true if disposing

GetAllRoles()

Gets all roles.

Declaration
public abstract IEnumerable<IUIRole> GetAllRoles()
Returns
Type Description
System.Collections.Generic.IEnumerable<IUIRole>

Roles

GetAllRolesForUser(String)

Gets all available roles for a user.

Declaration
public abstract IEnumerable<string> GetAllRolesForUser(string userName)
Parameters
Type Name Description
System.String userName

The user name

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

List of role name

GetRoleProviderName(String)

Get the role provider if the provider aggregate providers then it can be used to resolve the provider.

Declaration
public virtual string GetRoleProviderName(string name)
Parameters
Type Name Description
System.String name

The name of provider

Returns
Type Description
System.String

The provider name

GetRolesForUser(String)

Gets a list of the roles that a user is in.

Declaration
public abstract IEnumerable<string> GetRolesForUser(string username)
Parameters
Type Name Description
System.String username

The user name

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

A string array containing the names of all the roles that the specified user is in.

GetUsersInRole(String)

Gets a list of users in the specified role.

Declaration
public abstract IEnumerable<string> GetUsersInRole(string roleName)
Parameters
Type Name Description
System.String roleName

The role name

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

GetUsersInRole(String, String)

Gets a list of users in the specified role for the configured applicationName.

Declaration
public virtual IEnumerable<string> GetUsersInRole(string providerName, string roleName)
Parameters
Type Name Description
System.String providerName

The name of provider

System.String roleName

The role name

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

IsSupported(ProviderActions)

Determines whether a provider supports a specific EPiServer.Security.ProviderActions.

Declaration
public virtual bool IsSupported(ProviderActions action)
Parameters
Type Name Description
ProviderActions action

Action on provider EPiServer.Security.ProviderActions

Returns
Type Description
System.Boolean

Returns true if action on provider is supported otherwise false.

RemoveUserFromRole(String, String)

Removes the specified user from the specified role.

Declaration
public abstract void RemoveUserFromRole(string userName, string roleName)
Parameters
Type Name Description
System.String userName

The user name

System.String roleName

The role name

RemoveUserFromRoles(String, IEnumerable<String>)

Removes the specified user from the specified roles.

Declaration
public abstract void RemoveUserFromRoles(string username, IEnumerable<string> roleNames)
Parameters
Type Name Description
System.String username

The user name

System.Collections.Generic.IEnumerable<System.String> roleNames

The list of role name

RemoveUsersFromRoles(IEnumerable<String>, IEnumerable<String>)

Removes the specified user names from the specified roles.

Declaration
public abstract void RemoveUsersFromRoles(IEnumerable<string> usernames, IEnumerable<string> roleNames)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> usernames

List of user names

System.Collections.Generic.IEnumerable<System.String> roleNames

list of roles

RemoveUsersFromRoles(String, IEnumerable<String>, IEnumerable<String>)

Removes the specified user names from the specified roles.

Declaration
public virtual void RemoveUsersFromRoles(string providerName, IEnumerable<string> usernames, IEnumerable<string> roleNames)
Parameters
Type Name Description
System.String providerName

The provider name

System.Collections.Generic.IEnumerable<System.String> usernames

The list of user names

System.Collections.Generic.IEnumerable<System.String> roleNames

The list of roles

RoleExists(String)

Gets a value indicating whether the specified role name already exists.

Declaration
public abstract bool RoleExists(string roleName)
Parameters
Type Name Description
System.String roleName

The role name

Returns
Type Description
System.Boolean

Implements

System.IDisposable

Extension Methods