Activities of "liangshiwei"

Hi,

The project you provided is complex, I actually can't build solution, can you use suite to create a new project to reproduce it? thanks.

Hi,

Can you share your dbcontext code?

Answer

Hi,

No we have no plan. you can check:

Application Insights Google analytics

Hi

You should not remove Index.js from embedded resources.

I test the project you provied but didn't get any error.

Hi

Can you check this? https://support.abp.io/QA/Questions/1386/Can't-log-in-as-new-tenant#answer-a265843f-df4c-4f23-9128-39fcdeeec049

Hi,

I have tried, but can not reproduce the problem, can you provide a project? thanks. shiwei.liang@volosoft.com

Hi,

you can't use proxy file to download files, It only works for json objects.

This is the download method code of the file management module, you can refer it:

downloadFile(file: FileInfo) {
    return this.fileDescriptorService.getDownloadToken(file.id).pipe(
      tap((res) => {
        window.open(
          `${this.apiUrl}/api/file-management/file-descriptor/download/${file.id}?token=${res.token}`,
          '_self'
        );
      })
    );
  }

Hi,

Try:

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IMethodInvocationAuthorizationService))]
public class MyMethodInvocationAuthorizationService : IMethodInvocationAuthorizationService, ITransientDependency
{
    private readonly IAbpAuthorizationPolicyProvider _abpAuthorizationPolicyProvider;
    private readonly IAbpAuthorizationService _abpAuthorizationService;

    public MyMethodInvocationAuthorizationService(IAbpAuthorizationPolicyProvider abpAuthorizationPolicyProvider, IAbpAuthorizationService abpAuthorizationService)
    {
        _abpAuthorizationPolicyProvider = abpAuthorizationPolicyProvider;
        _abpAuthorizationService = abpAuthorizationService;
    }

    public async Task CheckAsync(MethodInvocationAuthorizationContext context)
    {
        if (AllowAnonymous(context))
        {
            return;
        }

        var authorizationPolicy = await AuthorizationPolicy.CombineAsync(
            _abpAuthorizationPolicyProvider,
            GetAuthorizationDataAttributes(context.Method)
        );

        if (authorizationPolicy == null)
        {
            return;
        }


        var result = await _abpAuthorizationService.AuthorizeAsync(authorizationPolicy);

        if (!result.Succeeded)
        {
            var requirements = result.Failure.FailedRequirements;

            var missingPermissionBuilder = new StringBuilder();

            foreach (var requirement in requirements)
            {
                if (requirement is PermissionRequirement abpRequirement)
                {
                    missingPermissionBuilder.AppendLine(abpRequirement.PermissionName);
                }
            }

            throw new AuthorizationException(
                $"The next permissions are required:\r\n\r\n{missingPermissionBuilder}");
        }
    }

    protected virtual bool AllowAnonymous(MethodInvocationAuthorizationContext context)
    {
        return context.Method.GetCustomAttributes(true).OfType<IAllowAnonymous>().Any();
    }

    protected virtual IEnumerable<IAuthorizeData> GetAuthorizationDataAttributes(MethodInfo methodInfo)
    {
        var attributes = methodInfo
            .GetCustomAttributes(true)
            .OfType<IAuthorizeData>();

        if (methodInfo.IsPublic && methodInfo.DeclaringType != null)
        {
            attributes = attributes
                .Union(
                    methodInfo.DeclaringType
                        .GetCustomAttributes(true)
                        .OfType<IAuthorizeData>()
                );
        }

        return attributes;
    }
}

Is this what you want?

Hi,

I will check it.

You will notice that I deleted the file link, because your license is included in the source code, I don't think you want to disclose it :)

Showing 5501 to 5510 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 17, 2025, 07:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.