mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
chore(core): Add custom role management service and endpoints (#18717)
This commit is contained in:
@@ -82,13 +82,17 @@ const credentialRoleTranslations = computed<Record<string, string>>(() => {
|
||||
});
|
||||
|
||||
const credentialRoles = computed<AllRolesMap['credential']>(() => {
|
||||
return rolesStore.processedCredentialRoles.map(({ role, scopes, licensed, description }) => ({
|
||||
role,
|
||||
name: credentialRoleTranslations.value[role],
|
||||
scopes,
|
||||
licensed,
|
||||
description,
|
||||
}));
|
||||
return rolesStore.processedCredentialRoles.map(
|
||||
({ slug, scopes, licensed, description, systemRole, roleType }) => ({
|
||||
slug,
|
||||
displayName: credentialRoleTranslations.value[slug],
|
||||
scopes,
|
||||
licensed,
|
||||
description,
|
||||
systemRole,
|
||||
roleType,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
const sharingSelectPlaceholder = computed(() =>
|
||||
|
||||
@@ -164,7 +164,12 @@ watch(
|
||||
size="small"
|
||||
@update:model-value="onRoleAction(project, $event)"
|
||||
>
|
||||
<N8nOption v-for="role in roles" :key="role.role" :value="role.role" :label="role.name" />
|
||||
<N8nOption
|
||||
v-for="role in roles"
|
||||
:key="role.slug"
|
||||
:value="role.slug"
|
||||
:label="role.displayName"
|
||||
/>
|
||||
</N8nSelect>
|
||||
<N8nButton
|
||||
v-if="!props.static"
|
||||
|
||||
@@ -89,13 +89,23 @@ describe('WorkflowShareModal.ee.vue', () => {
|
||||
projectsStore.personalProjects = [createProjectListItem()];
|
||||
rolesStore.processedWorkflowRoles = [
|
||||
{
|
||||
name: 'Editor',
|
||||
role: 'workflow:editor',
|
||||
displayName: 'Editor',
|
||||
slug: 'workflow:editor',
|
||||
scopes: [],
|
||||
licensed: false,
|
||||
description: 'Editor',
|
||||
systemRole: true,
|
||||
roleType: 'workflow',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
slug: 'workflow:owner',
|
||||
scopes: [],
|
||||
licensed: false,
|
||||
description: 'Owner',
|
||||
systemRole: true,
|
||||
roleType: 'workflow',
|
||||
},
|
||||
{ name: 'Owner', role: 'workflow:owner', scopes: [], licensed: false, description: 'Owner' },
|
||||
];
|
||||
|
||||
workflowSaving = useWorkflowSaving({ router: useRouter() });
|
||||
|
||||
@@ -108,13 +108,20 @@ const workflowRoleTranslations = computed(() => ({
|
||||
}));
|
||||
|
||||
const workflowRoles = computed(() =>
|
||||
rolesStore.processedWorkflowRoles.map(({ role, scopes, licensed, description }) => ({
|
||||
role,
|
||||
name: workflowRoleTranslations.value[role],
|
||||
scopes,
|
||||
licensed,
|
||||
description,
|
||||
})),
|
||||
rolesStore.processedWorkflowRoles.map(
|
||||
({ slug, scopes, displayName, licensed, description, systemRole, roleType }) => ({
|
||||
slug,
|
||||
displayName:
|
||||
slug in workflowRoleTranslations.value
|
||||
? workflowRoleTranslations.value[slug as keyof typeof workflowRoleTranslations.value]
|
||||
: displayName,
|
||||
scopes,
|
||||
licensed,
|
||||
description,
|
||||
systemRole,
|
||||
roleType,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const trackTelemetry = (eventName: string, data: ITelemetryTrackProperties) => {
|
||||
|
||||
Reference in New Issue
Block a user