mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 11:37:06 +00:00
feat: go greppy
This commit is contained in:
@@ -45,8 +45,7 @@ export const membershipGroupDALFactory = (db: TDbClient) => {
|
||||
} else if (scopeData.scope === AccessScope.Namespace) {
|
||||
void qb
|
||||
.where(`${TableName.Membership}.scope`, AccessScope.Namespace)
|
||||
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId)
|
||||
.whereNull(`${TableName.Membership}.scopeNamespaceId`);
|
||||
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId);
|
||||
} else if (scopeData.scope === AccessScope.Project) {
|
||||
void qb
|
||||
.where(`${TableName.Membership}.scope`, AccessScope.Project)
|
||||
@@ -148,8 +147,7 @@ export const membershipGroupDALFactory = (db: TDbClient) => {
|
||||
} else if (scopeData.scope === AccessScope.Namespace) {
|
||||
void qb
|
||||
.where(`${TableName.Membership}.scope`, AccessScope.Namespace)
|
||||
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId)
|
||||
.whereNull(`${TableName.Membership}.scopeNamespaceId`);
|
||||
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId);
|
||||
} else if (scopeData.scope === AccessScope.Project) {
|
||||
void qb
|
||||
.where(`${TableName.Membership}.scope`, AccessScope.Project)
|
||||
|
||||
@@ -57,7 +57,7 @@ export const membershipGroupServiceFactory = ({
|
||||
const hasNoPermanentRole = data.roles.every((el) => el.isTemporary);
|
||||
if (hasNoPermanentRole) {
|
||||
throw new BadRequestError({
|
||||
message: "Group must have atleast one permanent role"
|
||||
message: "Group must have at least one permanent role"
|
||||
});
|
||||
}
|
||||
const isInvalidTemporaryRole = data.roles.some((el) => {
|
||||
@@ -151,7 +151,7 @@ export const membershipGroupServiceFactory = ({
|
||||
const hasNoPermanentRole = data.roles.every((el) => el.isTemporary);
|
||||
if (hasNoPermanentRole) {
|
||||
throw new BadRequestError({
|
||||
message: "Group must have atleast one permanent role"
|
||||
message: "Group must have at least one permanent role"
|
||||
});
|
||||
}
|
||||
const isInvalidTemporaryRole = data.roles.some((el) => {
|
||||
|
||||
@@ -84,7 +84,7 @@ export const newOrgMembershipGroupFactory = ({
|
||||
|
||||
const onDeleteMembershipGroupGuard: TMembershipGroupScopeFactory["onDeleteMembershipGroupGuard"] = async () => {
|
||||
throw new BadRequestError({
|
||||
message: "Organization membership cannot be created for organization scoped group"
|
||||
message: "Organization membership cannot be deleted for organization scoped group"
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export const newProjectMembershipGroupFactory = ({
|
||||
if (!permissionBoundary.isValid)
|
||||
throw new PermissionBoundaryError({
|
||||
message: constructPermissionErrorMessage(
|
||||
"Failed to create group project membership",
|
||||
"Failed to update group project membership",
|
||||
shouldUseNewPrivilegeSystem,
|
||||
ProjectPermissionGroupActions.GrantPrivileges,
|
||||
ProjectPermissionSub.Groups
|
||||
|
||||
Reference in New Issue
Block a user