Group support #2031

Closed
opened 2026-04-06 02:49:47 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @MFijak on 8/2/2022

Hello all,
This is my first ever pull request and I also never used Rust before. Please tell me if I did anything wrong.
I implemented the group support, which is related to issue #1623.

To test my changes following sites can be used:

  • Organizations->Manage->People
    • Groups can be assigned to people (hover over a member and click the gear symbol)
    • Delete a member
  • Organizations->Manage->Collections
    • Collections can be assigned to groups (click on a collection)
    • Delete a collection
    • Add a collection
  • Organizations->Manage->Groups
    • Create a group (top right “+ New Group”)
    • Modify a group (click on a group)
    • Delete a group (click on a group)
    • Users can be added to groups (hover over a group and click the gear symbol)
  • Vaults
    • Should list any collections which are visible by the user

There was one code segment I was not so sure about if my implementation is the correct approach:

pub async fn find_by_user_uuid(user_uuid: &str, conn: &DbConn)
Db/models/collection.rs

This function basically returns all collections which the user has access to. I squeezed my group implementation into the query builder. Maybe a better approach would be to fire two independent queries. Each for user collections and group collections. I think this would be the better approach, because you can much clearer see what the query does. But I would assume there comes a small performance penalty.

*Originally created by @MFijak on 8/2/2022* Hello all, This is my first ever pull request and I also never used Rust before. Please tell me if I did anything wrong. I implemented the group support, which is related to issue #1623. To test my changes following sites can be used: - Organizations->Manage->People - Groups can be assigned to people (hover over a member and click the gear symbol) - Delete a member - Organizations->Manage->Collections - Collections can be assigned to groups (click on a collection) - Delete a collection - Add a collection - Organizations->Manage->Groups - Create a group (top right “+ New Group”) - Modify a group (click on a group) - Delete a group (click on a group) - Users can be added to groups (hover over a group and click the gear symbol) - Vaults - Should list any collections which are visible by the user There was one code segment I was not so sure about if my implementation is the correct approach: `pub async fn find_by_user_uuid(user_uuid: &str, conn: &DbConn)` _Db/models/collection.rs_ This function basically returns all collections which the user has access to. I squeezed my group implementation into the query builder. Maybe a better approach would be to fire two independent queries. Each for user collections and group collections. I think this would be the better approach, because you can much clearer see what the query does. But I would assume there comes a small performance penalty.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#2031