mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-19 12:55:26 +02:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -125,7 +125,9 @@ export const member = pgTable("member", {
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
role: text("role").notNull().$type<"owner" | "member" | "admin" | (string & {})>(),
|
||||
role: text("role")
|
||||
.notNull()
|
||||
.$type<"owner" | "member" | "admin" | (string & {})>(),
|
||||
createdAt: timestamp("created_at").notNull(),
|
||||
teamId: text("team_id"),
|
||||
isDefault: boolean("is_default").notNull().default(false),
|
||||
|
||||
@@ -265,10 +265,7 @@ export const checkServiceAccess = async (
|
||||
|
||||
await checkPermission(ctx, { service: [action] });
|
||||
|
||||
if (
|
||||
memberRecord.role !== "owner" &&
|
||||
memberRecord.role !== "admin"
|
||||
) {
|
||||
if (memberRecord.role !== "owner" && memberRecord.role !== "admin") {
|
||||
if (action === "create") {
|
||||
if (!memberRecord.accessedProjects.includes(serviceId)) {
|
||||
throw new TRPCError({
|
||||
@@ -352,10 +349,7 @@ export const checkEnvironmentDeletionPermission = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const addNewProject = async (
|
||||
ctx: PermissionCtx,
|
||||
projectId: string,
|
||||
) => {
|
||||
export const addNewProject = async (ctx: PermissionCtx, projectId: string) => {
|
||||
const userId = ctx.user.id;
|
||||
const organizationId = ctx.session.activeOrganizationId;
|
||||
const memberRecord = await findMemberByUserId(userId, organizationId);
|
||||
@@ -395,10 +389,7 @@ export const addNewEnvironment = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const addNewService = async (
|
||||
ctx: PermissionCtx,
|
||||
serviceId: string,
|
||||
) => {
|
||||
export const addNewService = async (ctx: PermissionCtx, serviceId: string) => {
|
||||
const userId = ctx.user.id;
|
||||
const organizationId = ctx.session.activeOrganizationId;
|
||||
const memberRecord = await findMemberByUserId(userId, organizationId);
|
||||
|
||||
@@ -74,7 +74,8 @@ export const getAuditLogs = async (input: GetAuditLogsInput) => {
|
||||
|
||||
if (userId) conditions.push(eq(auditLog.userId, userId));
|
||||
if (userEmail) conditions.push(ilike(auditLog.userEmail, `%${userEmail}%`));
|
||||
if (resourceName) conditions.push(ilike(auditLog.resourceName, `%${resourceName}%`));
|
||||
if (resourceName)
|
||||
conditions.push(ilike(auditLog.resourceName, `%${resourceName}%`));
|
||||
if (action) conditions.push(eq(auditLog.action, action));
|
||||
if (resourceType) conditions.push(eq(auditLog.resourceType, resourceType));
|
||||
if (from) conditions.push(gte(auditLog.createdAt, from));
|
||||
|
||||
Reference in New Issue
Block a user