Class MemberIndexAuthorizer
Inheritance
Namespace: Umbraco.Cms.Api.Management.Services
Assembly: Umbraco.Cms.Api.Management.dll
Syntax
public class MemberIndexAuthorizer : IMemberIndexAuthorizer
Constructors
View SourceMemberIndexAuthorizer(IExamineManager, IAuthorizationService)
Initializes a new instance of the MemberIndexAuthorizer class.
Declaration
public MemberIndexAuthorizer(IExamineManager examineManager, IAuthorizationService authorizationService)
Parameters
| Type | Name | Description |
|---|---|---|
| IExamineManager | examineManager | The Examine.IExamineManager used to resolve indexes by name. |
| IAuthorizationService | authorizationService | The Microsoft.AspNetCore.Authorization.IAuthorizationService used to evaluate section access. |
Methods
View SourceHasAccessAsync(ClaimsPrincipal)
Gets a value indicating whether the supplied principal may access member data.
Declaration
public Task<bool> HasAccessAsync(ClaimsPrincipal principal)
Parameters
| Type | Name | Description |
|---|---|---|
| ClaimsPrincipal | principal | The principal to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
|
IsMemberIndex(IIndex)
Gets a value indicating whether the supplied index holds member data.
Declaration
public bool IsMemberIndex(IIndex index)
Parameters
| Type | Name | Description |
|---|---|---|
| IIndex | index | The index to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
IsMemberIndex(string)
Gets a value indicating whether the supplied name identifies an index holding member data.
Declaration
public bool IsMemberIndex(string indexOrSearcherName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | indexOrSearcherName | The name of the index, or of the index's searcher, to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Both names are matched because a searcher can be resolved either by its index name or by its own name - see TryFindSearcher(string, out ISearcher). A searcher registered on its own, without a backing index, cannot be classified and is therefore treated as not holding member data.