Class SecurityEntityProviderExtensions
Convenience extension methods for SecurityEntityProvider
Inheritance
Namespace: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public static class SecurityEntityProviderExtensions : Object
Methods
FindUsersInRole(SecurityEntityProvider, String, String)
Returns users that are part of given role.
Declaration
public static IEnumerable<string> FindUsersInRole(this SecurityEntityProvider securityEntityProvider, string roleName, string usernameToMatch)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
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. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | All matched users in role |
FindUsersInRoleAsync(SecurityEntityProvider, String, String)
Returns users that are part of given role.
Declaration
public static Task<IEnumerable<string>> FindUsersInRoleAsync(this SecurityEntityProvider securityEntityProvider, string roleName, string usernameToMatch)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
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. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>> | The Task that represents the asynchronous operation, containing a list matched users in role. |
GetUsersInRole(SecurityEntityProvider, String)
Returns users that are part of given role.
Declaration
public static IEnumerable<string> GetUsersInRole(this SecurityEntityProvider securityEntityProvider, string roleName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
System.String | roleName | The name of the role to get users for |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | All users in role |
GetUsersInRole(SecurityEntityProvider, String, Int32, Int32, out Int32)
Returns users that are part of given role.
Declaration
public static IEnumerable<string> GetUsersInRole(this SecurityEntityProvider securityEntityProvider, string roleName, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
System.String | roleName | The name of the role to get users for |
System.Int32 | startIndex | The start index, used for paging |
System.Int32 | maxRows | The maximum number of rows returned |
System.Int32 | totalCount | The total amount of matched entites. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | Matching users |
GetUsersInRoleAsync(SecurityEntityProvider, String)
Returns users that are part of given role.
Declaration
public static Task<IEnumerable<string>> GetUsersInRoleAsync(this SecurityEntityProvider securityEntityProvider, string roleName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
System.String | roleName | The name of the role to get users for |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>> | The Task that represents the asynchronous operation, containing A list users in role. |
GetUsersInRoleAsync(SecurityEntityProvider, String, Int32, Int32)
Returns users that are part of given role.
Declaration
public static Task<ValueTuple<IEnumerable<string>, int>> GetUsersInRoleAsync(this SecurityEntityProvider securityEntityProvider, string roleName, int startIndex, int maxRows)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The security entity provider that is extended |
System.String | roleName | The name of the role to get users 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<System.String>, System.Int32>> | The Task that represents the asynchronous operation, containing a list matched users and total number of users. |
SearchRoles(SecurityEntityProvider, String)
Search all roles matching partOfName
.
Declaration
public static IEnumerable<SecurityEntity> SearchRoles(this SecurityEntityProvider securityEntityProvider, string partOfName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the role name to match. Null or String.Empty will return all roles. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SecurityEntity> | A list of matching roles. |
SearchRoles(SecurityEntityProvider, String, Int32, Int32, out Int32)
Search all roles matching partOfName
.
Declaration
public static IEnumerable<SecurityEntity> SearchRoles(this SecurityEntityProvider securityEntityProvider, string partOfName, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the role name to match. Null or String.Empty will return all roles. |
System.Int32 | startIndex | The start index, used for paging |
System.Int32 | maxRows | The maximum number of rows returned |
System.Int32 | totalCount | The total amount of matched entites. Return -1 if provider does not support paging. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SecurityEntity> | A list of all matching entities or an empty list if no matches. |
SearchRolesAsync(SecurityEntityProvider, String)
Search all roles matching partOfName
.
Declaration
public static Task<IEnumerable<SecurityEntity>> SearchRolesAsync(this SecurityEntityProvider securityEntityProvider, string partOfName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the role name to match. Null or String.Empty will return all roles. |
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. |
SearchRolesAsync(SecurityEntityProvider, String, Int32, Int32)
Search all roles matching partOfName
.
Declaration
public static Task<ValueTuple<IEnumerable<SecurityEntity>, int>> SearchRolesAsync(this SecurityEntityProvider securityEntityProvider, string partOfName, int startIndex, int maxRows)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the role name to match. Null or String.Empty will return all roles. |
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 or an empty list if no matches and total number of entities. |
SearchUsersByEmail(SecurityEntityProvider, String)
Search all users with an email matching partOfEmail
.
Declaration
public static IEnumerable<SecurityEntity> SearchUsersByEmail(this SecurityEntityProvider securityEntityProvider, string partOfEmail)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfEmail | part of the email to match. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SecurityEntity> | A list of matching users. |
SearchUsersByEmailAsync(SecurityEntityProvider, String)
Search all users with an email matching partOfEmail
.
Declaration
public static Task<IEnumerable<SecurityEntity>> SearchUsersByEmailAsync(this SecurityEntityProvider securityEntityProvider, string partOfEmail)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfEmail | part of the email to match. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<SecurityEntity>> | The Task that represents the asynchronous operation, containing A list of matching users. |
SearchUsersByName(SecurityEntityProvider, String)
Search all users with a matching partOfName
.
Declaration
public static IEnumerable<SecurityEntity> SearchUsersByName(this SecurityEntityProvider securityEntityProvider, string partOfName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the user name to match. Null or String.Empty will return all users. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SecurityEntity> | A list of matching users. |
SearchUsersByName(SecurityEntityProvider, String, Int32, Int32, out Int32)
Search all users matching partOfName
.
Declaration
public static IEnumerable<SecurityEntity> SearchUsersByName(this SecurityEntityProvider securityEntityProvider, string partOfName, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the user name to match. Null or String.Empty will return all users. |
System.Int32 | startIndex | The start index, used for paging |
System.Int32 | maxRows | The maximum number of rows returned |
System.Int32 | totalCount | The total amount of matched entites. Return -1 if provider does not support paging. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SecurityEntity> | A list of all matching entities or an empty list if no matches. |
SearchUsersByNameAsync(SecurityEntityProvider, String)
Search all users with a matching partOfName
.
Declaration
public static Task<IEnumerable<SecurityEntity>> SearchUsersByNameAsync(this SecurityEntityProvider securityEntityProvider, string partOfName)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the user name to match. Null or String.Empty will return all users. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<SecurityEntity>> | The Task that represents the asynchronous operation, containing A list of matching users. |
SearchUsersByNameAsync(SecurityEntityProvider, String, Int32, Int32)
Search all users matching partOfName
.
Declaration
public static Task<ValueTuple<IEnumerable<SecurityEntity>, int>> SearchUsersByNameAsync(this SecurityEntityProvider securityEntityProvider, string partOfName, int startIndex, int maxRows)
Parameters
Type | Name | Description |
---|---|---|
SecurityEntityProvider | securityEntityProvider | The provider that is extended |
System.String | partOfName | part of the user name to match. Null or String.Empty will return 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<SecurityEntity>, System.Int32>> | The Task that represents the asynchronous operation, containing A list of matching users and total number of users. |