Rename user archive action to deactivate

"Archive" was misleading for users: the action sets a profile to
DEACTIVATED while keeping the person in the organization. Rename it to
"deactivate" across the API, CLI, MCP, n8n, and console UI.

Consolidate the two overlapping operations into a single deactivateUser
backed by the fuller, guarded logic (SCIM guard, last-active-owner
guard, invitation expiry, signature cancellation, membership update,
webhook) and authorized via iam:membership-profile:deactivate. Remove
the archiveUser surface and the thin state-only deactivate path.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-28 17:30:14 +02:00
parent 99c3235b46
commit b10fc55b7f
14 changed files with 130 additions and 208 deletions

View File

@@ -29,7 +29,7 @@ export const description: INodeProperties[] = [
displayOptions: {
show: {
resource: ['user'],
operation: ['archiveUser'],
operation: ['deactivateUser'],
},
},
default: '',
@@ -43,11 +43,11 @@ export const description: INodeProperties[] = [
displayOptions: {
show: {
resource: ['user'],
operation: ['archiveUser'],
operation: ['deactivateUser'],
},
},
default: '',
description: 'The ID of the user (profile) to archive in the organization',
description: 'The ID of the user (profile) to deactivate in the organization',
required: true,
},
];
@@ -60,9 +60,9 @@ export async function execute(
const userId = this.getNodeParameter('userId', itemIndex) as string;
const query = `
mutation ArchiveUser($input: ArchiveUserInput!) {
archiveUser(input: $input) {
archivedProfileId
mutation DeactivateUser($input: DeactivateUserInput!) {
deactivateUser(input: $input) {
success
}
}
`;

View File

@@ -19,7 +19,7 @@
// SOFTWARE.
import type { INodeProperties } from 'n8n-workflow';
import * as archiveUserOp from './archiveUser.operation';
import * as deactivateUserOp from './deactivateUser.operation';
import * as listUsersOp from './listUsers.operation';
import * as getUserOp from './getUser.operation';
import * as createUserOp from './createUser.operation';
@@ -40,18 +40,18 @@ export const description: INodeProperties[] = [
},
},
options: [
{
name: 'Archive',
value: 'archiveUser',
description: 'Archive a user in the organization',
action: 'Archive a user',
},
{
name: 'Create',
value: 'createUser',
description: 'Create a new user in the organization',
action: 'Create a user',
},
{
name: 'Deactivate',
value: 'deactivateUser',
description: 'Deactivate a user in the organization',
action: 'Deactivate a user',
},
{
name: 'Get',
value: 'getUser',
@@ -91,7 +91,7 @@ export const description: INodeProperties[] = [
],
default: 'listUsers',
},
...archiveUserOp.description,
...deactivateUserOp.description,
...listUsersOp.description,
...getUserOp.description,
...createUserOp.description,
@@ -102,7 +102,7 @@ export const description: INodeProperties[] = [
];
export {
archiveUserOp as archiveUser,
deactivateUserOp as deactivateUser,
listUsersOp as listUsers,
getUserOp as getUser,
createUserOp as createUser,