mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 20:27:43 +00:00
misc: finalized error message
This commit is contained in:
@@ -100,7 +100,7 @@ export const groupServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to create a more privileged group",
|
"Failed to create group",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
OrgPermissionGroupActions.ManagePrivileges,
|
OrgPermissionGroupActions.ManagePrivileges,
|
||||||
OrgPermissionSubjects.Groups
|
OrgPermissionSubjects.Groups
|
||||||
@@ -185,7 +185,7 @@ export const groupServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to update a more privileged group",
|
"Failed to update group",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
OrgPermissionGroupActions.ManagePrivileges,
|
OrgPermissionGroupActions.ManagePrivileges,
|
||||||
OrgPermissionSubjects.Groups
|
OrgPermissionSubjects.Groups
|
||||||
|
|||||||
@@ -188,7 +188,9 @@ const constructPermissionErrorMessage = (
|
|||||||
opSubject: OrgPermissionSet[1] | ProjectPermissionSet[1]
|
opSubject: OrgPermissionSet[1] | ProjectPermissionSet[1]
|
||||||
) => {
|
) => {
|
||||||
return `${baseMessage}${
|
return `${baseMessage}${
|
||||||
shouldUseNewPrivilegeSystem ? `. Missing permission ${opAction as string} on ${opSubject as string}` : ""
|
shouldUseNewPrivilegeSystem
|
||||||
|
? `. Missing permission ${opAction as string} on ${opSubject as string}`
|
||||||
|
: ". Privilege level is not high enough to perform this action"
|
||||||
}`;
|
}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export const groupProjectServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to assign group to a more privileged role",
|
"Failed to assign group to role",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionGroupActions.ManagePrivileges,
|
ProjectPermissionGroupActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Groups
|
ProjectPermissionSub.Groups
|
||||||
@@ -294,7 +294,7 @@ export const groupProjectServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to assign group to a more privileged role",
|
"Failed to assign group to role",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionGroupActions.ManagePrivileges,
|
ProjectPermissionGroupActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Groups
|
ProjectPermissionSub.Groups
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export const identityProjectServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to assign to a more privileged role",
|
"Failed to assign to role",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionIdentityActions.ManagePrivileges,
|
ProjectPermissionIdentityActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Identity
|
ProjectPermissionSub.Identity
|
||||||
@@ -212,7 +212,7 @@ export const identityProjectServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to change to a more privileged role",
|
"Failed to change role",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionIdentityActions.ManagePrivileges,
|
ProjectPermissionIdentityActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Identity
|
ProjectPermissionSub.Identity
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ export const identityUaServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to create client secret for a more privileged identity.",
|
"Failed to create client secret for identity.",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
OrgPermissionIdentityActions.CreateToken,
|
OrgPermissionIdentityActions.CreateToken,
|
||||||
OrgPermissionSubjects.Identity
|
OrgPermissionSubjects.Identity
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export const identityServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to create a more privileged identity",
|
"Failed to create identity",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
OrgPermissionIdentityActions.ManagePrivileges,
|
OrgPermissionIdentityActions.ManagePrivileges,
|
||||||
OrgPermissionSubjects.Identity
|
OrgPermissionSubjects.Identity
|
||||||
|
|||||||
@@ -951,7 +951,7 @@ export const orgServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
"Failed to invite user to a more privileged role in the project",
|
"Failed to invite user to the project",
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionMemberActions.ManagePrivileges,
|
ProjectPermissionMemberActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Member
|
ProjectPermissionSub.Member
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ export const projectMembershipServiceFactory = ({
|
|||||||
throw new ForbiddenRequestError({
|
throw new ForbiddenRequestError({
|
||||||
name: "PermissionBoundaryError",
|
name: "PermissionBoundaryError",
|
||||||
message: constructPermissionErrorMessage(
|
message: constructPermissionErrorMessage(
|
||||||
`Failed to change to a more privileged role ${requestedRoleChange}`,
|
`Failed to change role ${requestedRoleChange}`,
|
||||||
membership.shouldUseNewPrivilegeSystem,
|
membership.shouldUseNewPrivilegeSystem,
|
||||||
ProjectPermissionMemberActions.ManagePrivileges,
|
ProjectPermissionMemberActions.ManagePrivileges,
|
||||||
ProjectPermissionSub.Member
|
ProjectPermissionSub.Member
|
||||||
|
|||||||
Reference in New Issue
Block a user