2021-01-28 10:00:47 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userGroupOperations: INodeProperties[] = [
|
2021-01-28 10:00:47 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-01-28 10:00:47 -08:00
|
|
|
description: 'Choose an operation',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
|
|
|
description: 'Create a user to group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
|
|
|
description: 'Remove user from group',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-01-28 10:00:47 -08:00
|
|
|
|
|
|
|
export const userGroupFields: INodeProperties[] = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userGroup:add */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Usernames',
|
|
|
|
name: 'usernames',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Usernames to add to group. Multiples can be defined separated by comma.',
|
2021-01-28 10:00:47 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Group ID',
|
|
|
|
name: 'groupId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'ID of the group',
|
2021-01-28 10:00:47 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userGroup:remove */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Usernames',
|
|
|
|
name: 'usernames',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Usernames to remove from group. Multiples can be defined separated by comma.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Group ID',
|
|
|
|
name: 'groupId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'ID of the group to remove',
|
2021-01-28 10:00:47 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
];
|