Skip to content

Commit

Permalink
correct capabilities check
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Jul 3, 2020
1 parent e919958 commit d7f0b27
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { useAppDependencies } from '../../../app_context';
import { hasSaveAlertsCapability, hasExecuteActionsCapability } from '../../../lib/capabilities';
import { hasAllPrivilege, hasExecuteActionsCapability } from '../../../lib/capabilities';
import { Alert, AlertType, ActionType } from '../../../../types';
import {
ComponentOpts as BulkOperationsComponentOpts,
Expand All @@ -40,7 +40,6 @@ import { PLUGIN } from '../../../constants/plugin';
import { AlertEdit } from '../../alert_form';
import { AlertsContextProvider } from '../../../context/alerts_context';
import { routeToAlertDetails } from '../../../constants';
import { hasAllPrivilege } from '../../../lib/capabilities';

type AlertDetailsProps = {
alert: Alert;
Expand Down Expand Up @@ -72,7 +71,7 @@ export const AlertDetails: React.FunctionComponent<AlertDetailsProps> = ({
dataPlugin,
} = useAppDependencies();

const canSaveAlert = hasSaveAlertsCapability(capabilities);
const canSaveAlert = hasAllPrivilege(alert, alertType);
const canExecuteActions = hasExecuteActionsCapability(capabilities);
const actionTypesByTypeId = keyBy(actionTypes, 'id');
const hasEditButton =
Expand Down

0 comments on commit d7f0b27

Please sign in to comment.