membership: list child and parent groups (#107)
* Group page shows child and parent groups
* moved recursion as a helper
* reworked several funcs to return directly Group type
* added TransitiveGroups on homepage
* added circular reference detection
* improved performance of transitive groups
* minor fix
* GetAllTransitiveGroupsForGroup parameter changed to string
* cover getting transitive groups with unit test
* recursion logic needs fix
* refactor: reuse code for processing user/group transitive groups
* recursion fix
---------
Co-authored-by: Giorgi Lekveishvili <lekva@gl-mbp-m1-max.local>
diff --git a/core/auth/memberships/group.html b/core/auth/memberships/group.html
index 979777f..ac432d8 100644
--- a/core/auth/memberships/group.html
+++ b/core/auth/memberships/group.html
@@ -61,5 +61,31 @@
</tr>
{{- end }}
</table>
+ <h4>Transitive Groups</h4>
+ <table>
+ <tr>
+ <th>Group Name</th>
+ <th>Description</th>
+ </tr>
+ {{- range .TransitiveGroups }}
+ <tr>
+ <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
+ <td>{{ .Description }}</td>
+ </tr>
+ {{- end }}
+ </table>
+ <h3>Child Groups</h3>
+ <table>
+ <tr>
+ <th>Group Name</th>
+ <th>Description</th>
+ </tr>
+ {{- range .ChildGroups }}
+ <tr>
+ <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
+ <td>{{ .Description }}</td>
+ </tr>
+ {{- end }}
+ </table>
</body>
</html>