mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* wip: pull out all server dependencies * create new platform plugin * shim newPlatform plugin into legacy init * update server tests for migration refactor * cleanup interfaces * Only add ML links for sample data sets if full license from - 38120 * update test and fix typescript errors * Remove unused types
20 lines
926 B
JavaScript
20 lines
926 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
|
|
/*
|
|
* Contains utility functions related to x-pack security.
|
|
*/
|
|
|
|
export function isSecurityDisabled(xpackMainPlugin) {
|
|
const xpackInfo = (xpackMainPlugin && xpackMainPlugin.info);
|
|
// we assume that `xpack.isAvailable()` always returns `true` because we're inside x-pack
|
|
// if for whatever reason it returns `false`, `isSecurityDisabled()` would also return `false`
|
|
// which would result in follow-up behavior assuming security is enabled. This is intentional,
|
|
// because it results in more defensive behavior.
|
|
const securityInfo = (xpackInfo && xpackInfo.isAvailable() && xpackInfo.feature('security'));
|
|
return (securityInfo && securityInfo.isEnabled() === false);
|
|
}
|