diff --git a/src/plugins/kibana/public/discover/partials/share_search.html b/src/plugins/kibana/public/discover/partials/share_search.html
index 8e41617ae1f07..69fee7ad756d0 100644
--- a/src/plugins/kibana/public/discover/partials/share_search.html
+++ b/src/plugins/kibana/public/discover/partials/share_search.html
@@ -1,4 +1,5 @@
+ object-id="{{opts.savedSearch.id}}"
+ allow-embed="false">
diff --git a/src/ui/public/share/index.html b/src/ui/public/share/index.html
index 9d920b8ec1e1c..8ef8688d8b9e6 100644
--- a/src/ui/public/share/index.html
+++ b/src/ui/public/share/index.html
@@ -1,16 +1,16 @@
diff --git a/src/ui/public/share/index.js b/src/ui/public/share/index.js
index 08c06abbedae8..254f3c9e0b1ad 100644
--- a/src/ui/public/share/index.js
+++ b/src/ui/public/share/index.js
@@ -1,6 +1,7 @@
const app = require('ui/modules').get('kibana');
const _ = require('lodash');
const { parse } = require('querystring');
+const angular = require('angular');
app.directive('share', function (Private) {
const urlShortener = Private(require('./url_shortener'));
@@ -9,10 +10,12 @@ app.directive('share', function (Private) {
restrict: 'E',
scope: {
objectType: '@',
- objectId: '@'
+ objectId: '@',
+ setAllowEmbed: '&?allowEmbed'
},
template: require('ui/share/index.html'),
controller: function ($scope, $rootScope, $location) {
+ $scope.allowEmbed = $scope.setAllowEmbed ? $scope.setAllowEmbed() : true;
$scope.shortUrlsLoading = false;
function updateUrl(url) {