Edit Authentik groups: rename and change members
Apps → Authentik gets a Groups section for administrators: the groups with member counts, and an Edit form to rename one and put users in and take them out. Members are changed one user at a time, never by replacing the list. Everything is checked first and nothing changes unless all of it may; service accounts, the token's own account and the last active administrator losing that are refused. Whether a group makes administrators is shown, not changed. Groups that decide roles in this app (Settings → Sign-in) are marked and ask first. Audited with who was put in and taken out. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3618cb3ae8
commit
6c5a5f0bd6
10 files changed
+794
-9
No files matched your search
@@ -42,6 +42,15 @@ export function extractGroups(sources: Record<string, unknown>[], claim: string)
|
||||
|
||||
const norm = (s: string) => s.trim().toLowerCase();
|
||||
|
||||
/** The role a group of this name decides in this app, if any: "admin" or "operator" when roles follow the groups and the name is one of the named ones (compared the way sign-in does); otherwise null. */
|
||||
export function roleForGroupName(settings: Pick<SignInRoleSettings, "roleFromGroups" | "adminGroups" | "operatorGroups">, name: string): "admin" | "operator" | null {
|
||||
if (!settings.roleFromGroups) return null;
|
||||
const n = norm(name);
|
||||
if (settings.adminGroups.some((g) => norm(g) === n)) return "admin";
|
||||
if (settings.operatorGroups.some((g) => norm(g) === n)) return "operator";
|
||||
return null;
|
||||
}
|
||||
|
||||
/** The role these groups give: admin if any is an admin group, else operator if any is an operator group, else what `otherwise` says. */
|
||||
export function roleFromGroups(settings: SignInRoleSettings, groups: string[], current: UserRole): UserRole {
|
||||
const have = new Set(groups.map(norm));
|
||||
|
||||
Reference in new issue
Block a user