Auth and policies
Sign-in, password reset, email verification and API tokens. Policies stand next to the route, and a misspelt ability does not compile.
modules/user-profile/policies/ProfileLinkPolicy.ts
type OwnedLink = Pick<Row<'profile_links'>, 'user_id'>;
export class ProfileLinkPolicy {
delete(user: AuthUser, link: OwnedLink) {
return link.user_id === user.id || deny('user-profile.validation.own_profile');
}
}@marmeon/authAuthorization