Skip to content

Adding groups logic and restrictions - #454

Open
AgentScrubbles wants to merge 5 commits into
Drop-OSS:developfrom
AgentScrubbles:group-restrictions
Open

Adding groups logic and restrictions#454
AgentScrubbles wants to merge 5 commits into
Drop-OSS:developfrom
AgentScrubbles:group-restrictions

Conversation

@AgentScrubbles

@AgentScrubbles AgentScrubbles commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Adds "Groups" as a concept to drop, with the ability to ban certain age ratings from those groups.

This completes the server side for #236 , will need to test the clients.

Flow goes in two ways:

  1. If the admin is NOT using OIDC:
  • Go to the Users screen
  • Scroll down to groups
  • Add a new group
  • Add users to that group, and then ban age ratings from that group.
Screenshot_2026-07-29_09-30-35 Screenshot_2026-07-29_09-30-45
  1. If the admin IS using OIDC:
  • Go to Users screen
  • See existing groups
  • Ban age ratings from those groups

Both give the ability to ban age ratings from groups if desired, so an admin can create a "kids" group and from there select "ESRB AO" and "ESRB M" ratings which will no longer show up for kids.

@AgentScrubbles
AgentScrubbles marked this pull request as ready for review July 29, 2026 16:26

@DecDuck DecDuck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nitpicks for maintainability.

if (!group)
throw createError({ statusCode: 404, message: "Group not found" });

// eslint-disable-next-line drop/no-prisma-delete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a // SAFETY comment describing why the lint was turned off.

message: "Group name already exists",
});

// eslint-disable-next-line drop/no-prisma-delete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// SAFETY

if (!group)
throw createError({ statusCode: 404, message: "Group not found" });

// eslint-disable-next-line drop/no-prisma-delete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// SAFETY

},
});

return await prisma.userGroup.findUnique({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: it's kinda messy to return directly like, maybe assign it to a variable first and then return that?

}),
]);

return await prisma.bannedAgeRating.findMany({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same direct return nitpick as above.

if (oidcGroups === undefined) return;

if (oidcGroups.length === 0) {
// eslint-disable-next-line drop/no-prisma-delete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// SAFETY

select: { id: true },
});

// eslint-disable-next-line drop/no-prisma-delete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// SAFETY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants