Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
geropl committed Nov 25, 2024
1 parent ae26fdf commit 1479147
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion components/dashboard/src/menu/OrganizationSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ export default function OrganizationSelector() {
const getOrgURL = useGetOrgURL();
const { data: installationConfig } = useInstallationConfiguration();
const isDedicated = !!installationConfig?.isDedicatedInstallation;
// TODO(gpl) Feature flag, or solve completely different?
const multiOrg = true;

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

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

Expand Down
4 changes: 2 additions & 2 deletions components/server/src/user/user-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

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

0 comments on commit 1479147

Please sign in to comment.