简体   繁体   English

使用多租户或自定义解决方案

[英]Use multitenancy or custom solutions

It is not an issue but a question or advice on what is better approach given the concepts of abp.考虑到 abp 的概念,这不是问题,而是关于什么是更好的方法的问题或建议。 In my case there are different kind of roles that interact with some core entities.在我的例子中,有不同类型的角色与一些核心实体交互。 Let say.说吧。

Entities:实体:

MedicalClaim: FullAuditedEntity MedicalClaim: FullAuditedEntity

PharmacyClaim: FullAuditedEntity PharmacyClaim: FullAuditedEntity

Ticket: FullAuditedEntity票证:FullAuditedEntity

Roles:角色:

Admin行政

Manager经理

Auditor审计师

Insurer保险公司

ProfessionalBiller专业记账员

PharmacyBiller药剂师

HospitalBiller医院账单

Physician (User)医师(用户)

The real interaction with the defined Entities is Role to Role, ex.与已定义实体的真正交互是角色到角色,例如。 MedicalClaim is billed by ProfessionalBiller or Physician to an Insurer. MedicalClaim 由 ProfessionalBiller 或 Physician 向保险公司收取费用。 Users belong to a company or are individual physicians.用户属于公司或个人医生。 Manager, Admin and Auditor are users one level up. Manager、Admin 和 Auditor 是上一级用户。

MULTITENANCY = TRUE If using multitenancy approach how can i differentiate different kind of tenants in ABP, because every tenant is not the same kind of Customer and i need interactions between tenants. MULTITENANCY = TRUE如果使用多租户方法,我如何区分 ABP 中不同类型的租户,因为每个租户都不是同一种客户,我需要租户之间的交互。 In this case Admin, Manager and Auditor will be HOST users so they can manage Tenants and entities related to tenants (Medical Claims and Tickets).在这种情况下,Admin、Manager 和 Auditor 将是 HOST 用户,因此他们可以管理租户和与租户相关的实体(医疗索赔和票据)。 How to set automatic filtering so every tenant can see "own" entities, if PharmacyBiller bill to Insurer it should be filter in both cases, first when PharmacyBiller (FROM) user enter to the system and when Insurer (TO) enter to the system.如何设置自动过滤以便每个租户都可以看到“自己的”实体,如果 PharmacyBiller 向 Insurer 开具账单,则应该在两种情况下都进行过滤,首先是 PharmacyBiller (FROM) 用户进入系统时,以及 Insurer (TO) 进入系统时。 using multitenancy we get all the benefits (FEATURE, EDITIONS), so for example don't need to duplicate permissions per Roles.使用多租户我们可以获得所有好处(功能、版本),因此例如不需要为每个角色复制权限。 ex.前任。 PharmacyBiller (CAN_CREATE_CLAIM) and ProfessionalBiller (CAN_CREATE_CLAIM) and differentiate what kind of role by features ("PHARMACY_CLAIM") and ("PROFESSIONAL_CLAIM") PharmacyBiller (CAN_CREATE_CLAIM) 和 ProfessionalBiller (CAN_CREATE_CLAIM) 并通过特征 ("PHARMACY_CLAIM") 和 ("PROFESSIONAL_CLAIM") 区分什么样的角色

MULTITENACY = FALSE If we don't use multitenancy we lose all the concepts related to multitenancy and a lot of duplicated code rise, but maybe we get more flexibility with custom development. MULTITENACY = FALSE如果我们不使用多租户,我们就会失去与多租户相关的所有概念,并且会出现大量重复代码,但也许我们可以通过定制开发获得更大的灵活性。 An alternative here can be use OrganizationUnit, OrganizationUnitRole and permissions and treat every Role as an OrganizationUnit for filtering purpose.这里的替代方法是使用 OrganizationUnit、OrganizationUnitRole 和权限,并将每个角色视为一个 OrganizationUnit 以进行过滤。 Here every time we create any instance of a Role internally we need to create an OrganizationUnit so the source of EntityId can be unique to avoid polluting the User entity with a lot of null per role.在这里,每次我们在内部创建角色的任何实例时,我们都需要创建一个 OrganizationUnit,以便 EntityId 的源可以是唯一的,以避免每个角色使用大量 null 污染用户实体。

I think this is a very common scenario mentioned here on aspnetboilerplate/zero, and some hints are welcome from the community or support team (know the drawbacks of some solutions even when it make sense)我认为这是这里在 aspnetboilerplate/zero 上提到的一个非常常见的场景,欢迎社区或支持团队提供一些提示(即使有意义,也要知道某些解决方案的缺点)

aspnet boilerplate has multitenant filtering by default, if you want to disable it you can use https://aspnetboilerplate.com/Pages/Documents/Data-Filters , or check more details about the framework https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy?searchKey=multi-tenancy%20asp.net%20boilerplate aspnet 样板默认具有多租户过滤,如果要禁用它,可以使用https://aspnetboilerplate.com/Pages/Documents/Data-Filters ,或查看有关框架https://aspnetboilerplate.com/Pages的更多详细信息Documents/Multi-Tenancy?searchKey=multi-tenancy%20asp.net%20boilerplate

 var people1 = _personRepository.GetAllList ();
 using (_unitOfWorkManager.Current.DisableFilter (AbpDataFilters.FILTER_NAME_HERE))
 {
     var people2 = _personRepository.GetAllList ();
 }
 var people3 = _personRepository.GetAllList ();

I recommend using multitenant我建议使用多租户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM