mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 04:08:21 +00:00
feat: greepy review
This commit is contained in:
@@ -173,7 +173,7 @@ export enum EventType {
|
||||
UPDATE_TOKEN_IDENTITY_TOKEN_AUTH = "update-token-identity-token-auth",
|
||||
GET_TOKENS_IDENTITY_TOKEN_AUTH = "get-tokens-identity-token-auth",
|
||||
|
||||
CREATE_CHILD_ORGANIZATION = "create-child-organization",
|
||||
CREATE_SUB_ORGANIZATION = "create-child-organization",
|
||||
|
||||
ADD_IDENTITY_TOKEN_AUTH = "add-identity-token-auth",
|
||||
UPDATE_IDENTITY_TOKEN_AUTH = "update-identity-token-auth",
|
||||
@@ -609,8 +609,8 @@ interface GetSecretsEvent {
|
||||
};
|
||||
}
|
||||
|
||||
interface CreateChildOrganizationEvent {
|
||||
type: EventType.CREATE_CHILD_ORGANIZATION;
|
||||
interface CreateSubOrganizationEvent {
|
||||
type: EventType.CREATE_SUB_ORGANIZATION;
|
||||
metadata: {
|
||||
name: string;
|
||||
organizationId: string;
|
||||
@@ -3873,7 +3873,7 @@ interface PamResourceDeleteEvent {
|
||||
}
|
||||
|
||||
export type Event =
|
||||
| CreateChildOrganizationEvent
|
||||
| CreateSubOrganizationEvent
|
||||
| GetSecretsEvent
|
||||
| GetSecretEvent
|
||||
| CreateSecretEvent
|
||||
|
||||
@@ -212,9 +212,9 @@ export const permissionServiceFactory = ({
|
||||
const rootOrgId = permissionData?.[0]?.rootOrgId;
|
||||
const isChild = Boolean(rootOrgId);
|
||||
if (scope === OrganizationActionScope.ParentOrganization && isChild) {
|
||||
throw new BadRequestError({ message: `Child organization cannot do this operation` });
|
||||
throw new ForbiddenRequestError({ message: `Child organization cannot do this operation` });
|
||||
} else if (scope === OrganizationActionScope.ChildOrganization && !isChild) {
|
||||
throw new BadRequestError({ message: `Parent organization cannot do this operation` });
|
||||
throw new ForbiddenRequestError({ message: `Parent organization cannot do this operation` });
|
||||
}
|
||||
|
||||
const permissionFromRoles = permissionData.flatMap((membership) => {
|
||||
|
||||
Reference in New Issue
Block a user