Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show schedule options in advanced and modify task wizard if user has correct permissions #2472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use <predefined> to disable feed object editing and filter creation on feed status page [#2398](https://github.com/greenbone/gsa/pull/2398)

### Fixed
- Only show schedule options in advanced and modify task wizard if user has correct permissions [#2472](https://github.com/greenbone/gsa/pull/2472)

### Removed
- Removed export/download for report formats [#2427](https://github.com/greenbone/gsa/pull/2427)
Expand Down
5 changes: 3 additions & 2 deletions gsa/public/locales/gsa-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"\nYou might have followed an incorrect link and the {{entity}} does not exist.": "Möglicherweise sind Sie einem fehlerhaften Link gefolgt und die Ressource existiert nicht.",
" on Port {{port}}": " auf Port {{port}}",
" on port ": " auf Port ",
" or just create the task so you can run it manually later.": " oder nur die Aufgabe für ein späteres manuelles Starten erstellt werden soll.",
"# of CERT-Bund Advisories": "Anz. CERT-Bund-Adv",
"# of CERT-Bund Advs": "Anz. CERT-Bund-Advs",
"# of CPEs": "Anz. CPEs",
Expand Down Expand Up @@ -40,6 +41,7 @@
"(Global Object)": "(Globales Objekt)",
"(Target Host)": "(Ziel-Host)",
"(full license text)": "(vollständiger Lizenztext)",
", schedule the task for a later date and time,": ", ein Zeitplan für den Start zu einem späteren Zeitpunkt erstellt",
"1 user will be deleted": "1 Benutzer wird gelöscht",
"> 0.0": "> 0.0",
"A timeout for the request to url {{- url}} occurred.": "Zeitüberschreitung bei der Anfrage zur URL {{- url}}",
Expand Down Expand Up @@ -1143,7 +1145,6 @@
"Overrides": "Übersteuerungen",
"Overrides Filter": "Übersteuerungen-Filter",
"Overrides Text Word Cloud": "Übersteuerungen-Text-Wordcloud",
"Overrides are applied": "Übersteuerungen werden angewandt",
"Overrides by Active Days (Total: {{count}})": "Übersteuerungen nach aktiven Tagen (Gesamt: {{count}})",
"Overrides by Creation Time": "Übersteuerungen nach Erstellungszeit",
"Overrides for Task {{- name}}": "Übersteuerungen für Aufgabe {{- name}}",
Expand Down Expand Up @@ -1841,7 +1842,7 @@
"You are leaving GSA": "Sie verlassen den Greenbone Security Assistant.",
"You are using Internet Explorer 11. You might encounter appearance and performance issues.": "Sie nutzen Internet Explorer 11. Es kann zu Darstellungsfehlern und Problemen mit der Leistung kommen.",
"You are using keywords setting a minimum limit on severity.": "Sie benutzen Filterbefehle, die eine Minimalgrenze für den Schweregrad setzen.",
"You can choose, whether you want to run the scan immediately, schedule the task for a later date and time, or just create the task so you can run it manually later.": "Sie können wählen, ob der Scan automatisch gestartet, ein Zeitplan für den Start zu einem späteren Zeitpunkt erstellt oder nur die Aufgabe fär ein späteres manuelles Starten erstellt werden soll.",
"You can choose, whether you want to run the scan immediately": "Sie können wählen, ob der Scan automatisch gestartet",
"You should change the Alive Test Method of the target for the next scan. However, if the target hosts are indeed dead, the scan duration might increase significantly.": "Sie sollten die Methode des Erreichbarkeitstests des Ziels für den nächsten Scan ändern. Sollten die Ziel-Hosts tatsächlich unerreichbar sein, könnte sich die Scan-Dauer erheblich verlängern.",
"Your filter settings may be too refined.": "Ihre Filtereinstellungen könnten zu präzise sein.",
"Your filter settings may be too unrefined.": "Ihre Filtereinstellungen könnten zu unpräzise sein.",
Expand Down
71 changes: 38 additions & 33 deletions gsa/src/web/pages/tasks/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,39 +64,44 @@ export const ToolBarIcons = withCapabilities(
onContainerTaskCreateClick,
onTaskCreateClick,
onTaskWizardClick,
}) => (
<IconDivider>
<ManualIcon
page="scanning"
anchor="managing-tasks"
title={_('Help: Tasks')}
/>
{capabilities.mayOp('run_wizard') && (
<IconMenu icon={<WizardIcon />} onClick={onTaskWizardClick}>
{capabilities.mayCreate('task') && (
<MenuEntry title={_('Task Wizard')} onClick={onTaskWizardClick} />
)}
{capabilities.mayCreate('task') && (
<MenuEntry
title={_('Advanced Task Wizard')}
onClick={onAdvancedTaskWizardClick}
/>
)}
{capabilities.mayEdit('task') && (
<MenuEntry
title={_('Modify Task Wizard')}
onClick={onModifyTaskWizardClick}
/>
)}
</IconMenu>
)}

<NewIconMenu
onNewClick={onTaskCreateClick}
onNewContainerClick={onContainerTaskCreateClick}
/>
</IconDivider>
),
}) => {
const mayUseModifyTaskWizard =
capabilities.mayEdit('task') &&
(capabilities.mayCreate('alert') || capabilities.mayCreate('schedule'));
return (
<IconDivider>
<ManualIcon
page="scanning"
anchor="managing-tasks"
title={_('Help: Tasks')}
/>
{capabilities.mayOp('run_wizard') && (
<IconMenu icon={<WizardIcon />} onClick={onTaskWizardClick}>
{capabilities.mayCreate('task') && (
<MenuEntry title={_('Task Wizard')} onClick={onTaskWizardClick} />
)}
{capabilities.mayCreate('task') && (
<MenuEntry
title={_('Advanced Task Wizard')}
onClick={onAdvancedTaskWizardClick}
/>
)}
{mayUseModifyTaskWizard && (
<MenuEntry
title={_('Modify Task Wizard')}
onClick={onModifyTaskWizardClick}
/>
)}
</IconMenu>
)}

<NewIconMenu
onNewClick={onTaskCreateClick}
onNewContainerClick={onContainerTaskCreateClick}
/>
</IconDivider>
);
},
);

ToolBarIcons.propTypes = {
Expand Down
Loading