Hi @kresimirm, There can be more than one value for Role claim (AbpClaimTypes.Role
).
A claims identity can have multiple claims with the same ClaimType.
AbpClaimTypes.Role
in our situation.
ICurrentUser
interface to get all distinct role names. And then you can create an extension method to query the user is in multiple roles or not like below.public static class CurrentUserExtensions
{
public static bool IsInSpecifiedRoles(this ICurrentUser currentUser, string[] roles)
{
var userRoles = currentUser.Roles;
return userRoles.All(userRole => roles.Contains(userRole));
}
}
I can see you've released 4.4.3. Could you tell me whether this version contains impersonation feature for Angular?
Hi @rafal.woznicki, I'm sorry this feature is not included in 4.4.3. because the PR is still under review.
Hi @Neozz, I've made one small change to the code and create a PR. Please examine it, it should be fixed now.
Can you share the relevant logs?
Hi @Neozzz, I've made the necessary changes on your repo and send a pull-request. You can examine the PR and if your problem is resolved you can close the question.
Hi engincan, The names are different. I did not want to put the exact name out in the public domain. Are you free for a remote session? or please share your mail id. Thanks :)
You can send an email to engin.veske@volosoft.com. Thanks.
Hi @Neozzz, I've accepted your invitation and examine the project but I could not see the related entities (Employee, Contact and Address).
Sure, my github account: https://github.com/EngincanV
If you add your contacts through the Employee
entity as below (by using Contact collection)
var employee = new Employee();
employee.Contacts.Add(new Contact());
await _employeeRepository.CreateAsync(employee);
you also need to create constructor with id parameter for Employee
entity like you do for the Contact
entity.
Hi @Neozzz, does your problem be related with https://github.com/abpframework/abp/issues/2660?