Neo4j – Datenbank Abfragen (Rollen Cross Check)

Wähle eine Rollengruppe und prüfe quer über das korrekte Attribut z.B. Department

 

Input: Rollengruppe -> wähle Alle User dieser Gruppe und checke die Dapartmenteinträge der Accounts

Eigentlich müsste beides übereinstimmen.

 

Erweiterter Rollencheck

Input: Rollengruppe -> Alle Accounts -> Mitgliedschaft in anderen Rollengruppen?

 

Entscheidende Frage: Woran erkennt man die Rollengruppen – das muss im Vorfeld spezifiziert werden können. Z.B. weil die Gruppe mit einem „R_G…“ anfängt

 

profile MATCH (u:ADAccount) where u.type="person" and not u.department ="" and 
u.isactive="True" with distinct collect( distinct u.department) as department1, 
count(u) as Member MATCH (u:ADAccount)<-[:rel_member*..]-(g:ADAccount)-[:rel_member*..]
->(u1:ADAccount) where u.isactive="True" and (u.department in department1) and g.type=
"group" and g.name starts with "abt_" and not g.domain="local" and not g.grouptype=
"BuiltIn_Group" and not g.grouptype="Local_Distribution_Group" and not g.grouptype=
"Universal_Distribution_Group" and not g.grouptype="Global_Distribution_Group" with u, g, 
count(g) as A_Gruppen,Member, collect(distinct u1.department) as verbundene_Departments 
RETURN distinct u.department, Member,g.name, count (g) as Memberships,verbundene_Departments 
order by g.name, u.department,Memberships desc

 

 

Input: alle Gruppen die mit „abt_“ beginnen

 

u.department Member g.name Memberships verbundene_Departments
1-0 2 abt_all_el 1 [, A-G]
1-0 2 abt_cm 1 [GL, TBS, GL, VT]
1-0 2 abt_controlling_reporting 1 [BH, TBS, VT, GL, TBM, BH, GL, TBM, VT, TBE, TBW, TBW]
1-0 2 abt_management-meeting 1 [BH, TBM, GL, TB, TBW, TBE, A-21, TBS, GL]
1-0 2 abt_vt_reporting 1 [VR, VR, BH, TBM, GL, TBS, ET, VT, VT, TBE, TBW, VT, TBW, TBM, A-21]
A-21 10 abt_all 1 [TBE, , A-C22, IT, TBE, VT, MIS, MIS, TB, TBS, TBE, VT, TBE, TBE, TBW, TBW, TBW, TBE, MIS, VR, GL, VR, MIS, IT, BH, TBM, BH, MIS, TB, TBS, TBE, ET, KB, TBS, VT, , GF, , KB, IT, BH, TBS, ET, F&E, GL, TBM, IT, TB, IT, TBW, TB, TBM, KB, TBW, TBS, TBM, TB]
A-21 10 abt_controlling 1 [TBW, TBW, TBE, VT, TBM, TBW, TBM, TBS, A-C22, , GL, KB, BH, BH, GL, KB, BH, KB, TBS, ET, VT, , TBM, ET, IT, TBW, TBW, TBE, VT, TBM, TBW, TBM, TBS, A-C22, KB, TBS, ET, VT, , TBM, ET, IT]
A-21 10 abt_controlling_archiv 1 [GL, KB, BH, BH, GL, KB, BH]
A-21 10 abt_einkauf 1 [ET, BH, KB, VR, VR, BH, GL, GL, ET, BH, KB]
A-21 10 abt_ersatz 1 [TBM, ET, GF, GL, VR, GL, BH, VR, BH, TBS, MIS, BH, TBM, VT, ET]
A-21 10 abt_fe 1 [GL, F&E, IT, TBS, KB, BH, KB, IT, GL, TBW, VT, VT]