feat: add groups management with CRUD operations and policy target assignment
Add Group type with id, name, description, members array and optional user_ids field. Add name field to policy targets for display. Add groups API client methods for list, create, update and delete operations. Add GroupsPage component with create form, edit modal, member selection and table view. Add groups route and navigation item to Layout. Add reusable Modal component with title, subtitle and close handler. Update
This commit is contained in:
@@ -92,9 +92,11 @@ func (r *PGRepository) BuildSyncBundle(ctx context.Context, gatewayID uuid.UUID)
|
||||
coalesce(array_agg(distinct pd.destination::text) filter (where pd.destination is not null), '{}')
|
||||
from devices d
|
||||
join wireguard_peers wp on wp.device_id = d.id and wp.deleted_at is null
|
||||
left join group_memberships gm on gm.user_id = d.user_id
|
||||
left join policy_targets pt on (
|
||||
(pt.target_type = 'device' and pt.target_id = d.id) or
|
||||
(pt.target_type = 'user' and pt.target_id = d.user_id)
|
||||
(pt.target_type = 'user' and pt.target_id = d.user_id) or
|
||||
(pt.target_type = 'group' and pt.target_id = gm.group_id)
|
||||
)
|
||||
left join policy_destinations pd on pd.policy_id = pt.policy_id
|
||||
where d.gateway_id = $1 and d.deleted_at is null and d.status = 'active'
|
||||
|
||||
Reference in New Issue
Block a user