Closed mperk closed 3 years ago
Thank you @mperk I will review this. @maliming can you also review it before me? Thanks.
hi @mperk According to the current design, how do I get its users based on an ou id in the application service layer?
hi @mperk According to the current design, how do I get its users based on an ou id in the application service layer?
hi @maliming I think I missed it. I will commit it as soon as. Thank you.
class IdentityOrganizationUnit : AggregateRoot<Guid>
{
}
class IdentityUserOrganizationUnit : Entity
{
Guid UserId
Guid OrganizationUnitId
}
class IdentityRoleOrganizationUnit : Entity
{
Guid RoleId
Guid OrganizationUnitId
}
class IdentityUser : AggregateRoot<Guid>
{
ICollection<IdentityUserOrganizationUnit> OrganizationUnits
}
class IdentityRole : AggregateRoot<Guid>
{
ICollection<IdentityRoleOrganizationUnit> OrganizationUnits
}
IOrganizationUnitRepository
is used to get its structure, users, roles. (Getusers. Getroles
)
IdentityUserManager
and IdentityRoleManager
is used to manage the organization of users and roles. (AddToOrg. RemoveOrg getOrgList
..)
We can use IOrganizationUnitRepository
in IdentityUserStore
to get the role information of the user organization.
I'm not sure if we should merge OrganizationUnitManager
into IOrganizationUnitRepository
, because its methods all seem to be crud operations.
This is my simple idea, what do you think?
class IdentityOrganizationUnit : AggregateRoot<Guid> { } class IdentityUserOrganizationUnit : Entity { Guid UserId Guid OrganizationUnitId } class IdentityRoleOrganizationUnit : Entity { Guid RoleId Guid OrganizationUnitId } class IdentityUser : AggregateRoot<Guid> { ICollection<IdentityUserOrganizationUnit> OrganizationUnits } class IdentityRole : AggregateRoot<Guid> { ICollection<IdentityRoleOrganizationUnit> OrganizationUnits }
IOrganizationUnitRepository
is used to get its structure, users, roles. (Getusers. Getroles
)
IdentityUserManager
andIdentityRoleManager
is used to manage the organization of users and roles. (AddToOrg. RemoveOrg getOrgList
..)We can use
IOrganizationUnitRepository
inIdentityUserStore
to get the role information of the user organization.I'm not sure if we should merge
OrganizationUnitManager
intoIOrganizationUnitRepository
, because its methods all seem to be crud operations.This is my simple idea, what do you think?
Me too, I am not sure but I think it should be seperate.
In many cases, customers need to sort the organization by themselves. It is perfect to provide a sorting field in the basic module,
public float sorting {get; set;}
Floating point can be easily sorted by dragging in the front end
any update?
I will deeply review this (probably) tomorrow.
Hi all,
Thank you @mperk for your great contribution. As overall, it is really fine. However, I found some problems with the implementation. Some of them are minor, some of them are related to design decisions, but some of them are bugs (for example, OrganizationUnit
should not have a Children
property which violates the aggregate rule: reference other aggregates only by id. We should remove this collection, otherwise it fails when we want to insert this entity to a document database like MongoDB).
So, I moved this to v2.2 milestone (we'll release v2.1 today), will review deeper and write my comments in details.
BTW, @mperk, it would be appreciated if you solve the conflicts.
BTW, @mperk, it would be appreciated if you solve the conflicts.
I did it.
Hi,
No news about this merge ? :-P
or is it for later (when ? next month ... ) ?
Thanks
@vd3d It is planned in abp 2.2. March 05, 2020.
Thank you again @mperk for your great contribution. I checked it deeply and found some points to improve. However, I will handle them, finalize the feature and merge it in the v2.3 (sorry to move to to v2.3, but we need it). So, you don't need to make addinional commits.
Here, a list of my findings (notes for myself 🙂):
Identity.OrganizationUnit.MaxUserMembershipCount
is missing except EnglishMaximum length of the <see cref="Code"/> property
Remove Code reference from summarythrow new AbpException(string.Format("Can not set more than {0} organization unit for a user!", maxCount));
Should be business exception & localized.IdentityUserOrganizationUnit
and OrganizationUnitRole
: Cancel ISoftDelete implementation.public virtual ICollection<OrganizationUnit> Children { get; set; }
from OrganizationUnit
. It won't work for MongoDB. We first should add test to prove it.OrganizationUnitManager_Tests.AddRoleToOrganizationUnitAsync
is failing, should be fixedtenantId
should be the last parameter of the OrganizationUnit
and OrganizationUnitRole
constructors, and it should be optional.b.ConfigureByConvention();
for all entities.ConfigureAwait(false);
usages. They are not needed anymore.will it delay again?
If you are eager for this feature, you can implement it yourself.
Look forward to see this feature early, thank you guys.
We are actively working on this. Hopefully it will be released with the v2.6 (April 20th planned date).
When is the Organization units for the Identity module released?
Hopefully with this (2.8) release if we don't have any significiant problem. Still working on it.
Hi all,
Unfortunately, we won't be able to release this with v2.8. It is "almost" finished, but not well tested. This is a core feature (effects roles & permissions) and releasing it tomorrow (the release day) will be risky.
It will be definitely released with v2.9 (2 weeks later), sorry for the delay.
Hi @hikalkan! Is there any documentation on how to use this feature? Or could you please give a short instruction on how to get started with this.
hi @mgochmuradov You can temporarily refer to the explanation of aspnetboilerplate for this. https://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units
Will be documented here: https://docs.abp.io/en/abp/latest/Modules/Identity
Resolve #1666 Everything is done. If you can find a bug please send me. I want to fix. I found a bug but I can't fix. I don't know why. I want to your help with this. You can see the bug: OrganizationUnitManager_Tests => AddRoleToOrganizationUnitAsync