Groups
Reusable membership sets inside an organization. Add a group to an ACL once, every group member gets the grant — and gain or lose it as the group changes.
A group is a named set of org members. Sweetdocs lets you grant a group permission to a library, folder, or document — and every member of that group inherits the grant. Adding someone to the group later automatically extends the grant; removing them strips it.
Groups are the scaling mechanism for org permissions. With ~10 members you can grant per-person; with ~50 you want to grant per-team.
Groups
How groups are modeled
In the database:
groups—id,org_id,namegroup_members—group_id,user_id(composite primary key)
A user can be in any number of groups inside a given org. Groups are scoped to one org — you can’t share a group across orgs.
Creating a group
| Step | What happens |
|---|---|
| 1. Org page → Groups → New group | Opens the group editor |
| 2. Type a name | Required, must be unique within the org |
| 3. Pick members | Existing org members (anyone in org_members) |
| 4. Save | Inserts the groups row + a group_members row per picked user |
Only org Owners and Admins can create or delete groups. Members can see groups they belong to in the org page’s groups section, but they can’t create new ones.
Granting access with groups
Once a group exists, you can add it to the ACL of any:
- Library (whole org library shared with the group)
- Folder (everyone in the group gets access to that folder and its descendants)
- Document (single-doc grant — less common at the group level)
In the Share dialog, the principal type is either user or group. Picking a group from the people-picker sets principal_type = 'group' and the group’s UUID as principal_id in the acl_entries row.
The permissions resolver walks both user-direct ACL entries and group-membership-derived entries, and takes the highest level across both.
Group ACL entries vs. direct ACL entries
Both are first-class in acl_entries:
| Field | Direct user grant | Group grant |
|---|---|---|
principal_type | user | group |
principal_id | The user’s UUID | The group’s UUID |
level | read, write, or manage | Same |
So a single user could have a direct Read grant on a folder and also be in a group with Write on the same folder — the resolver returns Write, the higher of the two.
Examples
A few common patterns:
| You want | Set it up like this |
|---|---|
| Everyone in Engineering can edit the Architecture library | Add Engineering group to the Architecture library’s ACL at Write |
| Only Leadership can see the comp folder | Mark the folder restricted, add the Leadership group at Read or Write |
| Anyone can read docs but only PMs can edit | Add Member-default Read on the library, add a PMs group at Write |
| New hires in Eng get full editor access from day one | Add them to the Engineering group, the existing Write grants flow through |
Changing membership
Adding or removing a user from a group is instantaneous — the next permissions resolve (which runs on every read and write in the app and DB) sees the new membership and applies it. There’s no caching, no propagation delay.
In particular: removing someone from a group immediately revokes any access that flowed through that group. The next request they make to a resource they only had via the group will return “access denied.”
Deleting a group
Org Owners and Admins can delete a group. Deletion:
- Removes the
groupsrow - Cascades to delete every
group_membersrow (the users themselves are untouched) - Cascades to delete every
acl_entriesrow that pointed at the group as principal - Loses the audit trail of who was in the group when (consider exporting first if you need it)
This is destructive — every grant that depended on the group’s membership disappears at once.
What’s not in v1
| Missing | Notes |
|---|---|
| Nested groups (a group inside a group) | Not modeled — each user is a direct member of each group |
| Auto-managed groups (e.g., “everyone in the Engineering email subdomain”) | Not in v1 — group membership is explicit |
| Per-group settings or branding | Not in v1 |
| Group-level invites (invite a person who’ll auto-join when accepting) | Not in v1 — invite as a Member, then add to groups |
| Group history or member-change audit | Currently the org’s audit log captures the change events, but per-group views aren’t surfaced yet |