November Happy Hour will be moved to Thursday December 5th.

Class SynchronizingRolesSecurityEntityProvider

Inheritance
System.Object
SynchronizingRolesSecurityEntityProvider
Namespace: EPiServer.Security
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class SynchronizingRolesSecurityEntityProvider : SecurityEntityProvider

Constructors

SynchronizingRolesSecurityEntityProvider()

Declaration
public SynchronizingRolesSecurityEntityProvider()

SynchronizingRolesSecurityEntityProvider(ISynchronizedUsersRepository, ClaimTypeOptions)

Declaration
public SynchronizingRolesSecurityEntityProvider(ISynchronizedUsersRepository synchingUsersRepository, ClaimTypeOptions claimTypeOptions)
Parameters
Type Name Description
ISynchronizedUsersRepository synchingUsersRepository

The ISynchronizedUsersRepository used.

ClaimTypeOptions claimTypeOptions

The claim type options used

Methods

FindUsersInRoleAsync(String, String, Int32, Int32)

Returns users that are part of given role.

Declaration
public override Task<ValueTuple<IEnumerable<string>, int>> FindUsersInRoleAsync(string roleName, string usernameToMatch, int startIndex, int maxRows)
Parameters
Type Name Description
System.String roleName

The name of the role to get users for

System.String usernameToMatch

The username to match for. Pass in null to match all users.

System.Int32 startIndex

The start index, used for paging

System.Int32 maxRows

The maximum number of rows returned

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<System.Collections.Generic.IEnumerable<System.String>, System.Int32>>

The Task that represents the asynchronous operation, containing A list of matched users and total users.

Overrides
Remarks

The recommendation is to support partly matches on usernameToMatch. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

Default implementation returns empty list. Should be overridden to support functionality.

Implemenations should return empty list when role does not exist

GetRolesForUserAsync(String)

Retrieves all roles for user with given userName.

Declaration
public override Task<IEnumerable<string>> GetRolesForUserAsync(string userName)
Parameters
Type Name Description
System.String userName

The name of the user.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

The Task that represents the asynchronous operation, containing A list of all roles for the user.

Overrides

SearchAsync(String, String)

Searches all security entities of given type with a matching name.

Declaration
public override Task<IEnumerable<SecurityEntity>> SearchAsync(string partOfValue, string claimType)
Parameters
Type Name Description
System.String partOfValue

Part of value to match or null to get all of given type.

System.String claimType

The claimType to search for.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<SecurityEntity>>

The Task that represents the asynchronous operation, containing A list of all matching entities or an empty list if no matches.

Overrides
Remarks

The recommendation is to support partly matches on partOfValue. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

SearchAsync(String, String, Int32, Int32)

Searches all security entities of given type with a matching name with paging support.

Declaration
public override Task<ValueTuple<IEnumerable<SecurityEntity>, int>> SearchAsync(string partOfValue, string claimType, int startIndex, int maxRows)
Parameters
Type Name Description
System.String partOfValue

Part of value to match or null to get all of given type.

System.String claimType

The claim type to search for.

System.Int32 startIndex

The start index, used for paging

System.Int32 maxRows

The maximum number of rows returned

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<System.Collections.Generic.IEnumerable<SecurityEntity>, System.Int32>>

The Task that represents the asynchronous operation, containing A list of all matching entities and total number of entities.

Overrides
Remarks

The recommendation is to support partly matches on partOfValue. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

Extension Methods