Skip to content

Commit

Permalink
Remove FORBIDDEN_SLUGS
Browse files Browse the repository at this point in the history
  • Loading branch information
championshuttler committed Dec 20, 2021
1 parent de31383 commit e2930f6
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions components/gitpod-db/src/typeorm/team-db-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,6 @@ import { DBTeamMembership } from "./entity/db-team-membership";
import { DBUser } from "./entity/db-user";
import { DBTeamMembershipInvite } from "./entity/db-team-membership-invite";

const FORBIDDEN_SLUGS = [
'access-control',
'account',
'admin',
'blocked',
'branches',
'from-referrer',
'install-github-app',
'integrations',
'issues',
'login',
'merge-requests',
'new',
'notifications',
'oauth-approval',
'plans',
'prebuilds',
'preferences',
'projects',
'pull-requests',
'settings',
'setup',
'snapshots',
'sorry',
'start',
'subscription',
'teams',
'upgrade-subscription',
'usage',
'variables',
'workspaces',
...(blocklist),
].sort((a, b) => b > a ? -1 : 1);

@injectable()
export class TeamDBImpl implements TeamDB {
Expand Down Expand Up @@ -129,9 +96,6 @@ export class TeamDBImpl implements TeamDB {
throw new Error('Please choose a team name containing only letters, numbers, -, _, \', or spaces.');
}
const slug = name.toLocaleLowerCase().replace(/[ ']/g, '-');
if (FORBIDDEN_SLUGS.indexOf(slug) !== -1) {
throw new Error('Creating a team with this name is not allowed');
}
const userRepo = await this.getUserRepo();
const existingUsers = await userRepo.query('SELECT COUNT(id) AS count FROM d_b_user WHERE fullName LIKE ? OR name LIKE ?', [ name, slug ]);
if (Number.parseInt(existingUsers[0].count) > 0) {
Expand Down

0 comments on commit e2930f6

Please sign in to comment.