from recent discussions, I found that there's a growing desire to re-design
the method for grouping of person entities such as persons, teams and
organisations. Therefore I think it's good to share what I'm currently working
on.
This piece of work has the codename "OU", but actually is about grouping and
hierarchies of person entities. Currently, the only two grouping mechanisms we
have are pr_group_membership (assigning persons to groups) and
hrm_human_resource (assigning persons to organisations). Only the latter is
tied to authorization, as "OrgAuth".
What I'm currently working on introduces a generic "affiliation" model, which
is pretty simple:
PE <- role <- affiliation -> PE
This model consists of exactly two tables: pr_role and pr_affiliation. For
every PE instance, you can define a number of roles and then link these roles
to other PE's via the affiliation link table.
A few examples:
OrganisationX <- "Members" (role) <-affiliation-> Persons
or:
Organisation <- "Regional Branches" (role) <-affiliation-> Organisation
or:
Group <- "Team Leaders" (role) <-affiliation-> Person
Group <- "Team Members" (role) <-affiliation-> Person
Organisation <- "Teams" (role) <-affiliation->Group
These "roles" can then also be used to assign permissions for the records of
the parent entity (=replacing the current OrgAuth).
For a quick setup, certain roles will be pre-defined per entity type
(something that I'd like to see happening per data pre-population rather than
in the code) - yet every particular PE can define new roles at any time.
Furthermore, this model can be used to construct hierarchies of PE's.
Initially, I'm going to implement exactly one hierarchy - but theoretically
there could be any number of hierarchies in this model (although I doubt that
this would still be usable then). For fast lookups within PE hierarchies, I've
implemented a multi-ancestor-path toolkit in s3model.py.
This model is going to replace pr_group_membership, so that in future pr_group
will have a much wider meaning (moving it from the person- to the PE level).
Regards,
Dominic