Activities of "sgal"

Answer

ABP Framework version: v4.2.1 UI type: Angular DB provider: EF Core Tiered (MVC) or Identity Server Seperated (Angular): yes Exception message and stack trace: Steps to reproduce the issue:

ABP suite didn't generate front-end code. My project name is Acme.BookStorePro , package.json The name in is bookstorepro

Answer

@alper I found some problem

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sgalcheung/.npm/_logs/2021-02-22T02_40_59_580Z-debug.log

and I open the 2021-02-22T02_40_59_580Z-debug.log The content of the problem is as follows

22 verbose stack Error: ENOTDIR: not a directory, open '/Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/angular/.suite/schematics/node_modules/.bin/ng/package.json'
23 verbose cwd /Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/angular
24 verbose Darwin 20.3.0
25 verbose argv "/usr/local/Cellar/node/15.5.0/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "/Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/angular/.suite/schematics/node_modules/.bin/ng" "g" ".suite/schematics/collection.json:entity" "app-pro" "Acme.BookStorePro" "/Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/aspnet-core/.suite/entities/Book.json"
26 verbose node v15.5.0
27 verbose npm  v7.3.0
28 error code ENOTDIR
29 error syscall open
30 error path /Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/angular/.suite/schematics/node_modules/.bin/ng/package.json
31 error errno -20
32 error ENOTDIR: not a directory, open '/Users/sgalcheung/Documents/StudyABP/AbpSuite/AngularSeparateTutorial/Acme.BookStorePro/angular/.suite/schematics/node_modules/.bin/ng/package.json'
33 verbose exit -20
Answer

@alper There is this directory, but ng looks like a js file, not a folder, so it does not contain package .json The abp suit page prompts that the generation is successful, yes, only CRUD is generated

Answer

@armanozak

When I use node v14, it can generate CRUD papges normally, npm still uses v7, no other problems have been found for the time being. Thanks!

Answer

About enum automatically obtain value problem When defining enum, the value can be obtained at compile time, but the entity.json generated by abp suite is null It is recommended to add this feature

Answer

Yes, it is precisely because of the problem that Angular has, so I found out that entity.json did not generate a value at all, it was just null @alper

Answer

When an entity has an AppUser navigation property, angular does not generate AppUserDto

Question
  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • I used the Tiered structure to develop, but when I was customizing the claims, I encountered some problems. Whether it was inheriting AbpUserClaimsPrincipalFactory and overriding the CreateAsync method, or implementing the IAbpClaimsPrincipalContributor interface, there were problems, but some people in the community said he could. I have done a lot of tests and found that it is normal in the project of the Not Tiered structure, but the Tiered structure does not work normally. Can this problem be solved as soon as possible, or is there another way to implement it?
  • related issue
    • [ICurrentUser #42](https://github.com/abpframework/abp/issues/42)
    • [When I create the code in your way, the class no work and breakpoints .Could you help me? #7973](https://github.com/abpframework/abp/issues/7973)
  • Steps to reproduce the issue: Using the BookStore example, create Tired and Not Tired respectively,add the following classes
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.Security.Claims;
using Volo.Abp.Uow;
using IdentityRole = Volo.Abp.Identity.IdentityRole;
using IdentityUser = Volo.Abp.Identity.IdentityUser;

namespace Hang.Blog.Web.MyIdentity
{
    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(AbpUserClaimsPrincipalFactory))]
    public class MyUserClaimsPrincipalFactory :
        AbpUserClaimsPrincipalFactory, ITransientDependency
    {

        public MyUserClaimsPrincipalFactory(
            UserManager<IdentityUser> userManager, 
            RoleManager<IdentityRole> roleManager,
            IOptions<IdentityOptions> options, 
            ICurrentPrincipalAccessor currentPrincipalAccessor, 
            IAbpClaimsPrincipalFactory abpClaimsPrincipalFactory) :
            base(userManager, roleManager, options, currentPrincipalAccessor, abpClaimsPrincipalFactory)
        {

        }


        [UnitOfWork]
        public override async Task<ClaimsPrincipal> CreateAsync(Volo.Abp.Identity.IdentityUser user)
        {

            var principal = await base.CreateAsync(user);
            principal.Identities
                .First().AddClaim(new Claim("Test", "123"));
            return principal;
        }
    }

}

or

using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.Security.Claims;
using Volo.Abp.Users;

namespace BookStore
{
    public class MyAbpClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency
    {
        private readonly IdentityUserManager _identityUserManager;

        public MyAbpClaimsPrincipalContributor(
            IdentityUserManager identityUserManager)
        {
            _identityUserManager = identityUserManager;
        }
        
        public async Task ContributeAsync(AbpClaimsPrincipalContributorContext context)
        {
            var identityUser = await _identityUserManager.GetUserAsync(context.ClaimsPrincipal);
            var organizationUnits = await _identityUserManager.GetOrganizationUnitsAsync(identityUser);
            
            
        }
    }
}

Hello, I try do this, and I realized that there was a problem with my previous understanding. I thought that the identity service was only used as a certification center, and then directly used dotnet run to run it. In the debug hostapi project, the rewritten code actually added needs to be called by the identity Server service Yes, the above two methods can be useful, but it is better to have a document description, thank you.

I also met the same requirement, using OU for data permissions and filtering data, you can refer to the following documents to achieve

Showing 1 to 10 of 47 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11