chore: Remove DEPLOYMENT and SUBDOMAINS_ENABLED (#5742)
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import env from "@server/env";
|
||||
import { buildUser, buildTeam, buildAdmin } from "@server/test/factories";
|
||||
import { setupTestDatabase } from "@server/test/support";
|
||||
import {
|
||||
setCloudHosted,
|
||||
setSelfHosted,
|
||||
setupTestDatabase,
|
||||
} from "@server/test/support";
|
||||
import { serialize } from "./index";
|
||||
|
||||
setupTestDatabase();
|
||||
|
||||
it("should allow reading only", async () => {
|
||||
setSelfHosted();
|
||||
|
||||
const team = await buildTeam();
|
||||
const user = await buildUser({
|
||||
teamId: team.id,
|
||||
@@ -21,6 +26,8 @@ it("should allow reading only", async () => {
|
||||
});
|
||||
|
||||
it("should allow admins to manage", async () => {
|
||||
setSelfHosted();
|
||||
|
||||
const team = await buildTeam();
|
||||
const admin = await buildAdmin({
|
||||
teamId: team.id,
|
||||
@@ -36,7 +43,7 @@ it("should allow admins to manage", async () => {
|
||||
});
|
||||
|
||||
it("should allow creation on hosted envs", async () => {
|
||||
env.DEPLOYMENT = "hosted";
|
||||
setCloudHosted();
|
||||
|
||||
const team = await buildTeam();
|
||||
const admin = await buildAdmin({
|
||||
|
||||
@@ -13,7 +13,7 @@ allow(User, "share", Team, (user, team) => {
|
||||
});
|
||||
|
||||
allow(User, "createTeam", Team, () => {
|
||||
if (!env.isCloudHosted()) {
|
||||
if (!env.isCloudHosted) {
|
||||
throw IncorrectEditionError("Functionality is only available on cloud");
|
||||
}
|
||||
return true;
|
||||
@@ -27,7 +27,7 @@ allow(User, "update", Team, (user, team) => {
|
||||
});
|
||||
|
||||
allow(User, ["delete", "audit"], Team, (user, team) => {
|
||||
if (!env.isCloudHosted()) {
|
||||
if (!env.isCloudHosted) {
|
||||
throw IncorrectEditionError("Functionality is only available on cloud");
|
||||
}
|
||||
if (!team || user.isViewer || user.teamId !== team.id) {
|
||||
|
||||
Reference in New Issue
Block a user