0
chofoza created
- ABP Framework version: v4.1.0
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Seperated (Angular): no
Hi, I feel like this is an easy one...
I have a new property (bool Active) on the User object, stored in ExtraProperties. I want to reference it on the razor page, but the CurrentUser (ICurrentUser) object doesn't have it or ExtraProperties. How can I read the value?
In my example basically I want to do:
@if (CurrentUser.IsAuthenticated && CurrentUser.ExtraProperties["Active"])
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
2 Answer(s)
-
0
hi
- You can use UserManager in razor page to get user's Active . https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Security/Volo/Abp/Users/CurrentUserExtensions.cs#L15
- You can also add this value into the cliams.https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory.cs#L29
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)