abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.95k stars 3.45k forks source link

Authorization failed UserLookup #14159

Closed VivienMAN closed 1 year ago

VivienMAN commented 2 years ago

Your ABP Framework version. => 6.0.0 RC4 Your User Interface type (Angular/MVC/React... etc.) => Blazor Servezr Your database provider(EF Core/MongoDB) => EfCore Steps needed to reproduce the problem.

In my exemple.razor

@inject IIdentityUserLookupAppService UserLookup

<Autocomplete TItem="UserData"
                                      TValue="Guid?"
                                      Data="@LUser"
                                      TextField="@(( item ) => item.UserName)"
                                      ValueField="@(( item ) => item.Id)"
                                      @bind-SelectedValue="@selectedSearchValue"
                                      @bind-SelectedText="selectedAutoCompleteText"
                                      Placeholder="Search..."
                                      Filter="AutocompleteFilter.StartsWith"
                                      SearchChanged="@GetPhotoDocLookupAsync">
                                <NotFoundContent> Sorry... @context was not found! :( </NotFoundContent>
                            </Autocomplete>

 private async Task GetPhotoDocLookupAsync(string newValue = null)
        {
            UserLookupSearchInputDto input = new UserLookupSearchInputDto();
            input.Filter = newValue;
            if (!newValue.IsNullOrWhiteSpace())
            {
                LUser = (await UserLookup.SearchAsync(input)).Items;
            }
        }

Error when I call UserLookup.SearchAsync(input)

[15:29:01 INF] Authorization failed. These requirements were not met: PermissionRequirement: AbpIdentity.UserLookup [15:38:17 INF] Authorization failed. These requirements were not met: PermissionRequirement: AbpIdentity.UserLookup

image

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.