Skip to content

Restrict partner colors by server membership #559

Description

@Rocked03

Turns out we never actually implemented this, we just left the allColorsGlobal switch set to true and called it a day

if (!color.global && !config.allColorsGlobal) {
throw new ForbiddenError(
`Partnered color with ID ${colorId} is not allowed from web client`,
);
}

We already get their server membership via auth, we just need to check against it. It's not high stakes so we shouldn't really need to validate the auth in the backend every time (ratelimits 😒), but it's probably worth instead keeping medium-length cache records that re-validates periodically

Metadata

Metadata

Assignees

Labels

backendAn issue related to our backend packagefrontendAn issue related to our frontend package

Type

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions