Activities of "liangshiwei"

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 :)

Hi,

Please share the project to me again. thanks.

Hi,

I can't reproduce the problem, can you share a simple project to reproduce? thanks. shiwei.liang@volosoft.com

Showing 4821 to 4830 of 6011 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 18, 2024, 05:54