Skip to content

Commit 1479147

Browse files
committed
WIP
1 parent ae26fdf commit 1479147

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

components/dashboard/src/menu/OrganizationSelector.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ export default function OrganizationSelector() {
2727
const getOrgURL = useGetOrgURL();
2828
const { data: installationConfig } = useInstallationConfiguration();
2929
const isDedicated = !!installationConfig?.isDedicatedInstallation;
30+
// TODO(gpl) Feature flag, or solve completely different?
31+
const multiOrg = true;
3032

3133
// we should have an API to ask for permissions, until then we duplicate the logic here
32-
const canCreateOrgs = user && !isOrganizationOwned(user) && !isDedicated;
34+
const canCreateOrgs = user && ((!isOrganizationOwned(user) && !isDedicated) || multiOrg);
3335

3436
const userFullName = user?.name || "...";
3537

components/server/src/user/user-authentication.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { injectable, inject } from "inversify";
88
import { User, Identity, Token, IdentityLookup } from "@gitpod/gitpod-protocol";
9-
import { EmailDomainFilterDB, MaybeUser, UserDB } from "@gitpod/gitpod-db/lib";
9+
import { BUILTIN_INSTLLATION_ADMIN_USER_ID, EmailDomainFilterDB, MaybeUser, UserDB } from "@gitpod/gitpod-db/lib";
1010
import { HostContextProvider } from "../auth/host-context-provider";
1111
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
1212
import { Config } from "../config";
@@ -198,7 +198,7 @@ export class UserAuthentication {
198198
* @returns
199199
*/
200200
async mayCreateOrJoinOrganization(user: User): Promise<boolean> {
201-
return !user.organizationId;
201+
return !user.organizationId || user.id === BUILTIN_INSTLLATION_ADMIN_USER_ID;
202202
}
203203

204204
async isBlocked(params: CheckIsBlockedParams): Promise<boolean> {

0 commit comments

Comments
 (0)