Hi,
I have added new properties in session as mentioned in my previous comment. (#2144@c5b10a0c-d398-45c3-b017-8cad6e9af9bc)
Now, I want to use this new property in Unit Tests. Can you please help me to figure out how this new property can be used in Unit Tests?
Thanks
Thanks!
Hi,
I have added a custom claim in login post method as below:
loginResult.Identity.AddClaim(new Claim("ParentUserId", Convert.ToString(user.ParentUserId)));
I have also added a property in AspNetZeroAbpSession class as below:
public long? ParentUserId
{
get
{
var parentUserIdClaim = PrincipalAccessor.Principal?.Claims.FirstOrDefault(c => c.Type == "ParentUserId");
if (string.IsNullOrEmpty(parentUserIdClaim?.Value))
{
return null;
}
return Convert.ToInt64(parentUserIdClaim.Value);
}
}
Now, I want to access this new property using AbpSession like AbpSession.ParentUserId, but I am not able to access it like that because IAbpSession interface does not have this new property. Is there any way to access this new property using AbpSession like AbpSession.ParentUserId?
Thanks
Thanks!
This is what I wanted.
Thanks again!
Hi,
I think you still didn't get me.
I do not want to update the existing functionality of the AbpAuditLogs table.
I want to change the values of entities fields like "CreatorUserId", "LastModifiedUserId", and "DeletedUserId". These are the fields of all auditable entities (like AbpUsers, AbpRoles etc) and not the AbpAuditLogs table.
Currently, irrespective of who is performing operation i.e. whether actual user or impersonator, these fields are updated by AbpSession.UserId (which always contains the actual user id, not the impersonator use id).
Hence, I want to save Impersonator User Id value in fields like "CreatorUserId", "LastModifiedUserId", and "DeletedUserId" for each entity, so that I can get who has performed that particular operation on any entity without looking into AbpAuditLogs.
Thanks
Hi,
I do not want to update AuditLogs.
I want to change the values which are saved in auditable entities fields like "CreatorUserId", "LastModifiedUserId", and "DeletedUserId". I think, currently, AbpSession.UserId is being saved in these fields for each auditable entity (for example...AbpRoles), instead I want to save AbpSession.ImpersonatorUserId value in these fields in case host logs in as tenant.
Thanks
Thanks!
Thanks!
Is there any way to use localization in Dtos? I want to use localization in Dtos in DataAnnotations for custom server side error messages.
For example, I want to use localization in TenantEditDto class like below:
[Required(ErrorMessage = "Please provide Name")]
public string Name { get; set; }
Hi,
You got it right!
But my question is how to specify multiple LocationSourceNames?
We set LocalizationSourceName in base classes like the one which derives from AbpWebViewPage. Below is the code snippet:
public abstract class DemoWebViewPageBase<TModel> : AbpWebViewPage<TModel>
{
public IAbpSession AbpSession { get; private set; }
protected DemoWebViewPageBase()
{
AbpSession = IocManager.Instance.Resolve<IAbpSession>();
LocalizationSourceName = DemoConsts.LocalizationSourceName;
}
}
In above code we can speficy only one LocalizationSourceName. How can we specify multiple here?
Thanks