rights system
This commit is contained in:
@@ -131,6 +131,19 @@ class PermissionService {
|
||||
return result.rows.map((r: any) => r.authentik_group);
|
||||
}
|
||||
|
||||
async getUnknownGroups(): Promise<string[]> {
|
||||
// Groups from users table that are not yet in the permission matrix
|
||||
const result = await pool.query(`
|
||||
SELECT DISTINCT g AS group_name
|
||||
FROM users, unnest(authentik_groups) AS g
|
||||
WHERE g LIKE 'dashboard_%'
|
||||
AND g NOT IN (SELECT DISTINCT authentik_group FROM group_permissions)
|
||||
AND g != 'dashboard_admin'
|
||||
ORDER BY group_name
|
||||
`);
|
||||
return result.rows.map((r: any) => r.group_name);
|
||||
}
|
||||
|
||||
async setGroupPermissions(group: string, permIds: string[], grantedBy: string): Promise<void> {
|
||||
const client = await pool.connect();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user