auth: groups and memberships (#97)
* group membership unpolished
* fixed index.html
* fixed undefined variable errors
* Implemented adding a user to a group.
* fixed variable names, moved permission check into handler, separated fanctionality for adding ownership or membership for user
* minor changes: Gave variables consistent names
* separated tables for owners and members. some clean code fixes. added group description into group page.
* added to creat child group. minor fixes
* added yaml files
* added cue file
* moved groupOwnership check separatly. redo conditionals into oneline. separated status string check.
* added mempership into app.go infraAppConfigs
* changed svg icon. fixed indentation
* svg icon fix
* added transaction
* minor owner add fix
* added multiple db rollbacks
---------
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
new file mode 100644
index 0000000..979777f
--- /dev/null
+++ b/core/auth/memberships/group.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="en" data-theme="light">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Group Membership Managment</title>
+ <link rel="stylesheet" href="/static/pico.2.0.6.min.css">
+ <link rel="stylesheet" href="/static/main.css">
+</head>
+<body class="container">
+ <div>
+ <h2 class="headline">{{ .GroupName }} Group Management</h2>
+ <p class="description">{{ .Description }}</p>
+ </div>
+ <hr class="divider">
+ <form action="/add-user" method="post">
+ <input type="hidden" id="group-name" name="group" value="{{ .GroupName }}">
+ <label for="group-name">Username:</label>
+ <input type="text" id="username" name="username" required>
+ <label for="status">Status:</label>
+ <select id="status" name="status" required>
+ <option value="Member" selected>Member</option>
+ <option value="Owner">Owner</option>
+ </select>
+ <button type="submit">Add Member</button>
+ </form>
+ <hr class="divider">
+ <form action="/add-child-group" method="post">
+ <input type="hidden" id="parent-group" name="parent-group" value="{{ .GroupName }}">
+ <label for="child-group">Select Child Group:</label>
+ <select id="child-group" name="child-group" required>
+ {{- range .AvailableGroups }}
+ <option value="{{ . }}">{{ . }}</option>
+ {{- end }}
+ </select>
+ <button type="submit">Create Child Group</button>
+ </form>
+ <h4>Owners</h4>
+ <table>
+ <tr>
+ <th>Username</th>
+ <th>Action</th>
+ </tr>
+ {{- range .Owners }}
+ <tr>
+ <td>{{ . }}</td>
+ <td>Delete</td>
+ </tr>
+ {{- end }}
+ </table>
+ <h4>Members</h4>
+ <table>
+ <tr>
+ <th>Username</th>
+ <th>Action</th>
+ </tr>
+ {{- range .Members }}
+ <tr>
+ <td>{{ . }}</td>
+ <td>Delete</td>
+ </tr>
+ {{- end }}
+ </table>
+</body>
+</html>