feat(rbac): fixed merge conflicts and resolved some more issues with permission checks

This commit is contained in:
Akhil Mohan
2023-09-08 21:22:36 +05:30
parent bcfe1bda84
commit f1a291a52a
13 changed files with 120 additions and 87 deletions
+1 -2
View File
@@ -6,7 +6,6 @@ import { MembershipNotFoundError } from "../utils/errors";
import { AuthData } from "../interfaces/middleware";
import { ActorType } from "../ee/models";
import { z } from "zod";
import { ADMIN, CUSTOM, MEMBER, VIEWER } from "../variables";
/**
* Validate authenticated clients for membership with id [membershipId] based
@@ -66,7 +65,7 @@ export const DeleteMembershipV1 = z.object({
export const ChangeMembershipRoleV1 = z.object({
body: z.object({
role: z.enum([ADMIN, VIEWER, MEMBER, CUSTOM])
role: z.string().trim()
}),
params: z.object({ membershipId: z.string().trim() })
});
+2 -2
View File
@@ -11,7 +11,7 @@ export const CreateRoleSchema = z.object({
.object({
subject: z.string(),
action: z.string(),
condition: z.record(z.union([z.string(), z.number()])).optional()
conditions: z.record(z.union([z.string(), z.number()])).optional()
})
.array()
})
@@ -31,7 +31,7 @@ export const UpdateRoleSchema = z.object({
.object({
subject: z.string(),
action: z.string(),
condition: z.record(z.union([z.string(), z.number()])).optional()
conditions: z.record(z.union([z.string(), z.number()])).optional()
})
.array()
.optional()