mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Security Solution][Lists] - Disable upload value lists if user is kibana read only (#126829)
Addresses #126326
This commit is contained in:
parent
0af4578c5f
commit
e3e5df6617
2 changed files with 6 additions and 3 deletions
|
@ -12,7 +12,7 @@ import {
|
|||
RULE_CHECKBOX,
|
||||
RULE_NAME,
|
||||
} from '../../screens/alerts_detection_rules';
|
||||
import { PAGE_TITLE } from '../../screens/common/page';
|
||||
import { VALUE_LISTS_MODAL_ACTIVATOR } from '../../screens/lists';
|
||||
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
|
||||
import { createCustomRule } from '../../tasks/api_calls/rules';
|
||||
import { cleanKibana } from '../../tasks/common';
|
||||
|
@ -35,6 +35,10 @@ describe('All rules - read only', () => {
|
|||
cy.get(RULE_CHECKBOX).should('not.exist');
|
||||
});
|
||||
|
||||
it('Disables value lists upload', () => {
|
||||
cy.get(VALUE_LISTS_MODAL_ACTIVATOR).should('be.disabled');
|
||||
});
|
||||
|
||||
it('Does not display action options', () => {
|
||||
// These are the 3 dots at the end of the row that opens up
|
||||
// options to take action on the rule
|
||||
|
@ -51,7 +55,6 @@ describe('All rules - read only', () => {
|
|||
|
||||
dismissCallOut(MISSING_PRIVILEGES_CALLOUT);
|
||||
cy.reload();
|
||||
cy.get(PAGE_TITLE).should('be.visible');
|
||||
cy.get(RULE_NAME).should('have.text', getNewRule().name);
|
||||
|
||||
getCallOut(MISSING_PRIVILEGES_CALLOUT).should('not.exist');
|
||||
|
|
|
@ -195,7 +195,7 @@ const RulesPageComponent: React.FC = () => {
|
|||
<EuiButton
|
||||
data-test-subj="open-value-lists-modal-button"
|
||||
iconType="importAction"
|
||||
isDisabled={!canWriteListsIndex || loading}
|
||||
isDisabled={!canWriteListsIndex || !canUserCRUD || loading}
|
||||
onClick={showValueListModal}
|
||||
>
|
||||
{i18n.UPLOAD_VALUE_LISTS}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue