Return-Path: X-Original-To: apmail-eagle-commits-archive@minotaur.apache.org Delivered-To: apmail-eagle-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4CFE180BC for ; Thu, 3 Dec 2015 03:16:57 +0000 (UTC) Received: (qmail 89383 invoked by uid 500); 3 Dec 2015 03:16:57 -0000 Delivered-To: apmail-eagle-commits-archive@eagle.apache.org Received: (qmail 89357 invoked by uid 500); 3 Dec 2015 03:16:57 -0000 Mailing-List: contact commits-help@eagle.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@eagle.incubator.apache.org Delivered-To: mailing list commits@eagle.incubator.apache.org Received: (qmail 89348 invoked by uid 99); 3 Dec 2015 03:16:57 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2015 03:16:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0F9DE180A62 for ; Thu, 3 Dec 2015 03:16:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.247 X-Spam-Level: * X-Spam-Status: No, score=1.247 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id bKoEQ1kYJ2hz for ; Thu, 3 Dec 2015 03:16:43 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id A22C520F5E for ; Thu, 3 Dec 2015 03:16:41 +0000 (UTC) Received: (qmail 89272 invoked by uid 99); 3 Dec 2015 03:16:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Dec 2015 03:16:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B8446E67E0; Thu, 3 Dec 2015 03:16:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hao@apache.org To: commits@eagle.incubator.apache.org Date: Thu, 03 Dec 2015 03:16:40 -0000 Message-Id: <40876a72df3e4b46b95c89cbf61558bc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-eagle git commit: support hbase sensitivity Repository: incubator-eagle Updated Branches: refs/heads/master de30b151e -> 369093cd7 support hbase sensitivity Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/5d977e6b Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/5d977e6b Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/5d977e6b Branch: refs/heads/master Commit: 5d977e6ba3cb2282a05b520693ee059b2c31f0d7 Parents: f9d688f Author: jiljiang Authored: Mon Nov 30 02:56:05 2015 +0000 Committer: jiljiang Committed: Mon Nov 30 02:56:05 2015 +0000 ---------------------------------------------------------------------- .../webapp/app/partials/dam/sensitivity.html | 16 +- .../app/partials/dam/sensitivity/HDFS.html | 110 -------- .../app/partials/dam/sensitivity/Hive.html | 150 ---------- .../app/partials/dam/sensitivity/folder.html | 110 ++++++++ .../app/partials/dam/sensitivity/table.html | 150 ++++++++++ .../app/partials/dam/sensitivitySummary.html | 62 ++--- .../src/main/webapp/app/public/js/app.js | 2 +- .../app/public/js/ctrl/sensitivityController.js | 271 +++++++++++-------- 8 files changed, 469 insertions(+), 402 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html index af73ee4..b00bbaf 100644 --- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html +++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity.html @@ -15,8 +15,18 @@ See the License for the specific language governing permissions and limitations under the License. --> -
-
- + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html deleted file mode 100644 index 70929c4..0000000 --- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/HDFS.html +++ /dev/null @@ -1,110 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
File NameOwnerGroupSensitivity Type
- - Loading... -
- - Empty Folder -
- - - {{getFileName(item)}} - - - - {{getFileName(item)}} - - - - - - {{item.owner}}{{item.group}}{{item.sensitiveType}} - - -
- - - - - -
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html deleted file mode 100644 index f276ee0..0000000 --- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/Hive.html +++ /dev/null @@ -1,150 +0,0 @@ - -
-

- - Loading... -

- -
-
- -
    -
  • - - - - {{db.database}} - ({{db.tables.length}}) - - - - - - - - - - [{{db.sensitiveType}}] - - -
      -
    • - - - Loading... - -
    • -
    • - - - - {{tb.table}} - - - - - - - - - - [{{tb.sensitiveType}}] - - -
    • -
    -
  • -
-
-
- -

- - Loading... -

-
- - - - - - - - - - - - - - - -
Column NameSensitivity Type
{{col.column}}{{col.sensitiveType}} - - -
-
-
-
- - - - - - - - -
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html new file mode 100644 index 0000000..1827eac --- /dev/null +++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/folder.html @@ -0,0 +1,110 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
File NameOwnerGroupSensitivity Type
+ + Loading... +
+ + Empty Folder +
+ + + {{getFileName(item)}} + + + + {{getFileName(item)}} + + + + + + {{item.owner}}{{item.group}}{{item.sensitiveType}} + + +
+ + + + + +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html new file mode 100644 index 0000000..baa824c --- /dev/null +++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivity/table.html @@ -0,0 +1,150 @@ + +
+

+ + Loading... +

+ +
+
+ +
    +
  • + + + + {{db.database}} + ({{db.tables.length}}) + + + + + + + + + + [{{db.sensitiveType}}] + + +
      +
    • + + + Loading... + +
    • +
    • + + + + {{tb.table}} + + + + + + + + + + [{{tb.sensitiveType}}] + + +
    • +
    +
  • +
+
+
+ +

+ + Loading... +

+
+ + + + + + + + + + + + + + + +
Column NameSensitivity Type
{{col.column}}{{col.sensitiveType}} + + +
+
+
+
+ + + + + + + + +
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html index 294b105..3dfe103 100644 --- a/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html +++ b/eagle-webservice/src/main/webapp/app/partials/dam/sensitivitySummary.html @@ -16,40 +16,40 @@ limitations under the License. -->
-
-
- -
-
- - -
+
+
+ +
+
+ + +
-
- {{entity.name}} - -
-
-
- - - {{entity.statisitc[0].value[0] || 0}} - sensitivity items - +
+ {{entity.name}} + +
+
-
-
+ + + {{entity.statisitc[0].value[0] || 0}} + sensitivity items + +
+
+
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/public/js/app.js ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/public/js/app.js b/eagle-webservice/src/main/webapp/app/public/js/app.js index c8654f3..220e586 100644 --- a/eagle-webservice/src/main/webapp/app/public/js/app.js +++ b/eagle-webservice/src/main/webapp/app/public/js/app.js @@ -132,7 +132,7 @@ eagleApp.config(function($routeProvider) { site: function(Site) {return Site._promise();}, auth: function(Authorization) {return Authorization._promise();}, }, - }).when('/dam/sensitivity', { + }).when('/dam/sensitivity/:dataSrc', { templateUrl : 'partials/dam/sensitivity.html', controller : 'sensitivityCtrl', reloadOnSearch: false, http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d977e6b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js ---------------------------------------------------------------------- diff --git a/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js index 0dd5ea5..7ae868b 100644 --- a/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js +++ b/eagle-webservice/src/main/webapp/app/public/js/ctrl/sensitivityController.js @@ -18,13 +18,70 @@ 'use strict'; +damControllers.service('SensitivityConfig', function(Site) { + var config = { + list: [ + { + name: "HDFS", + dataSrc: common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource"), + service: "FileSensitivityService", + keys: ["filedir", "sensitivityType"], + + type: "folder", + prefix: "fileSensitivity", + api: "hdfsResource", + }, + { + name: "Hive", + dataSrc: common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource"), + service: "HiveResourceSensitivityService", + keys: ["hiveResource", "sensitivityType"], + + type: "table", + prefix: "hiveResourceSensitivity", + api: { + database: "hiveResource/databases", + table: "hiveResource/tables", + column: "hiveResource/columns", + }, + mapping: { + database: "database", + table: "table", + column: "column", + }, + }, + { + name: "HBase", + dataSrc: common.array.find("hbaseSecurityLog", Site.current().dataSrcList, "tags.dataSource"), + service: "HbaseResourceSensitivityService", + keys: ["hbaseResource", "sensitivityType"], + type: "table", + prefix: "hbaseResourceSensitivity", + api: { + database: "hbaseResource/namespaces", + table: "hbaseResource/tables", + column: "hbaseResource/columns", + }, + mapping: { + database: "namespace", + table: "table", + column: "columnFamily", + }, + }, + ], + }; + + return config; +}); + // ============================================================= // = Sensitivity Summary = // ============================================================= -damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site, damContent, $scope, Entities) { +damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site, damContent, $scope, Entities, SensitivityConfig) { globalContent.setConfig(damContent.config); globalContent.pageTitle = "Data Classification"; globalContent.pageSubTitle = Site.current().name; + $scope.config = SensitivityConfig; $scope._sensitivitySource = null; $scope._sensitivityLock = false; @@ -32,31 +89,20 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site $scope._sensitivityFile = ""; $scope._sensitivityData = ""; $scope._sensitivityError = ""; - $scope.sensitivityList = []; - // TODO: Only support Hive & HDFS - if(common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource")) { - $scope.sensitivityList.push( - {name: "HDFS", service: "FileSensitivityService", keys: ["filedir", "sensitivityType"]} - ); - } - if(common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource")) { - $scope.sensitivityList.push( - {name: "Hive", service: "HiveResourceSensitivityService", keys: ["hiveResource", "sensitivityType"]} - ); - } - - function _refreshStatistic(entity) { + // ==================== Statistic ==================== + var _refreshStatistic = function(entity) { if(entity) { entity.statisitc = Entities.queryGroup(entity.service, {site: Site.current().name}, "@site", "count"); } else { - $.each($scope.sensitivityList, function(i, entity) { + $.each($scope.config.list, function(i, entity) { entity.statisitc = Entities.queryGroup(entity.service, {site: Site.current().name}, "@site", "count"); }); } - } + }; _refreshStatistic(); + // ================== Configuration ================== // Import sensitivity data $scope.showImportEditor = function(entity) { $scope._sensitivitySource = entity; @@ -82,7 +128,7 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site if(!Entities.dialog(data)) { $("#sensitivityMDL").modal('hide'); $scope._sensitivityData = ""; - + _refreshStatistic($scope._sensitivitySource); } }).finally(function() { @@ -198,90 +244,38 @@ damControllers.controller('sensitivitySummaryCtrl', function(globalContent, Site // ============================================================= // = Sensitivity = // ============================================================= -damControllers.controller('sensitivityCtrl', function(globalContent, Site, damContent, $scope, $q, $routeParams, $location, Entities) { +damControllers.controller('sensitivityCtrl', function(globalContent, Site, damContent, $scope, $routeParams, SensitivityConfig) { globalContent.setConfig(damContent.config); globalContent.pageTitle = "Data Classification"; globalContent.pageSubTitle = Site.current().name; - - $scope.sensitivityList = []; - $scope.type = $routeParams.type; + $scope.config = SensitivityConfig; $scope.ajaxId = Math.random(); - // TODO: Only support Hive & HDFS - if(common.array.find("hdfsAuditLog", Site.current().dataSrcList, "tags.dataSource")) { - $scope.sensitivityList.push( - {name: "HDFS"} - ); - } - if(common.array.find("hiveQueryLog", Site.current().dataSrcList, "tags.dataSource")) { - $scope.sensitivityList.push( - {name: "Hive"} - ); + // Check data source + $scope.dataSrc = common.array.find($routeParams.dataSrc, $scope.config.list, "name"); + if(!$scope.dataSrc) { + $.dialog({ + title: "OPS", + content: "Data Source '" + $routeParams.dataSrc + "' not found!" + }, function() { + Site.url('/dam/sensitivitySummary'); + }); } - - // Update search - $scope.$watch("type", function(value) { - $location.search("type", value); - }); }); -// ============================================================= -// = Sensitivity: HDFS = -// ============================================================= -damControllers.controller('sensitivityHDFSCtrl', function(globalContent, Site, damContent, $scope, $location, $q, Entities) { +// ============================================================== +// = Sensitivity - Folder = +// ============================================================== +damControllers.controller('sensitivityViewFolderCtrl', function(globalContent, Site, damContent, $scope, $location, Entities, SensitivityConfig) { $scope.path = $location.search().path || "/"; $scope.pathUnitList = []; - $scope.items = []; - /*$scope.$parent.$on("tab-change", function(event, pane) { - $location.search("path", pane.title === "HDFS" ? $scope.path : null); - });*/ - // Mark sensitivity $scope._oriItem = {}; $scope._markItem = {}; - $scope.markSensitivity = function(item) { - $scope._oriItem = item; - $scope._markItem = { - prefix: "fileSensitivity", - tags: { - site: Site.current().name, - filedir: item.resource - }, - sensitivityType: "" - }; - $("#sensitivityHdfsMDL").modal(); - setTimeout(function() { - $("#hdfsSensitiveType").focus(); - }, 500); - }; - $scope.confirmUpateSensitivity = function() { - $scope._oriItem.sensitiveType = $scope._markItem.sensitivityType; - var _promise = Entities.updateEntity("FileSensitivityService", $scope._markItem, {timestamp: false})._promise.success(function(data) { - Entities.dialog(data); - }); - $("#sensitivityHdfsMDL").modal('hide'); - }; - $scope.unmarkSensitivity = function(item) { - $.dialog({ - title: "Unmark Confirm", - content: "Do you want to remove the sensitivity mark on '" + item.resource + "'?", - confirm: true - }, function(ret) { - if(!ret) return; - - Entities.deleteEntities("FileSensitivityService", { - site: Site.current().name, - filedir: item.resource - }); - - item.sensitiveType = null; - $scope.$apply(); - }); - }; - + // ======================= View ======================= // Path function _refreshPathUnitList(_path) { var _start,_current, _unitList = []; @@ -302,15 +296,13 @@ damControllers.controller('sensitivityHDFSCtrl', function(globalContent, Site, d $scope.updateItems = function(path) { if(path) $scope.path = path; - $scope.items = Entities.query("hdfsResource", {site: Site.current().name, path: $scope.path}); + $scope.items = Entities.query($scope.dataSrc.api, {site: Site.current().name, path: $scope.path}); $scope.items._promise.success(function(data) { var $dlg = Entities.dialog(data, function() { if($scope.path !== "/") $scope.updateItems("/"); }); }); _refreshPathUnitList($scope.path); - - //$location.search("path", $scope.path); }; $scope.getFileName = function(item) { @@ -318,54 +310,118 @@ damControllers.controller('sensitivityHDFSCtrl', function(globalContent, Site, d }; $scope.updateItems($scope.path); + + // =================== Sensitivity =================== + $scope.markSensitivity = function(item) { + $scope._oriItem = item; + $scope._markItem = { + prefix: $scope.dataSrc.prefix, + tags: { + site: Site.current().name, + }, + sensitivityType: "" + }; + $scope._markItem.tags[$scope.dataSrc.keys[0]] = item.resource; + $("#sensitivityMDL").modal(); + setTimeout(function() { + $("#sensitiveType").focus(); + }, 500); + }; + $scope.confirmUpateSensitivity = function() { + $scope._oriItem.sensitiveType = $scope._markItem.sensitivityType; + var _promise = Entities.updateEntity($scope.dataSrc.service, $scope._markItem, {timestamp: false})._promise.success(function(data) { + Entities.dialog(data); + }); + $("#sensitivityMDL").modal('hide'); + }; + $scope.unmarkSensitivity = function(item) { + $.dialog({ + title: "Unmark Confirm", + content: "Do you want to remove the sensitivity mark on '" + item.resource + "'?", + confirm: true + }, function(ret) { + if(!ret) return; + + var _cond = {site: Site.current().name}; + _cond[$scope.dataSrc.keys[0]] = item.resource; + Entities.deleteEntities($scope.dataSrc.service, _cond); + + item.sensitiveType = null; + $scope.$apply(); + }); + }; }); // ============================================================= -// = Sensitivity: Hive = +// = Sensitivity - Table = // ============================================================= -damControllers.controller('sensitivityHiveCtrl', function(globalContent, Site, damContent, $scope, $q, Entities) { +damControllers.controller('sensitivityViewTableCtrl', function(globalContent, Site, damContent, $scope, $location, Entities, SensitivityConfig) { $scope.table = null; - $scope.databases = Entities.query("hiveResource/databases", {site: Site.current().name}); + // Mark sensitivity + $scope._oriItem = {}; + $scope._markItem = {}; + + // ======================= View ======================= + var _fillAttr = function(list, key, target) { + list._promise.then(function() { + $.each(list, function(i, unit) { + unit[key] = unit[target]; + }); + }); + }; + + $scope.databases = Entities.query($scope.dataSrc.api.database, {site: Site.current().name}); + _fillAttr($scope.databases, "database", $scope.dataSrc.mapping.database); + $scope.loadTables = function(database) { if(database.tables) return; - database.tables = Entities.query("hiveResource/tables", {site: Site.current().name, database: database.database}); + var _qry = { + site: Site.current().name + }; + _qry[$scope.dataSrc.mapping.database] = database[$scope.dataSrc.mapping.database]; + database.tables = Entities.query($scope.dataSrc.api.table, _qry); + _fillAttr(database.tables, "table", $scope.dataSrc.mapping.table); + _fillAttr(database.tables, "database", $scope.dataSrc.mapping.database); }; $scope.loadColumns = function(database, table) { $scope.table = table; if(table.columns) return; - table.columns = Entities.query("hiveResource/columns", {site: Site.current().name, database: database.database, table: table.table}); + var _qry = { + site: Site.current().name + }; + _qry[$scope.dataSrc.mapping.database] = database[$scope.dataSrc.mapping.database]; + _qry[$scope.dataSrc.mapping.table] = table[$scope.dataSrc.mapping.table]; + table.columns = Entities.query($scope.dataSrc.api.column, _qry); + _fillAttr(table.columns, "column", $scope.dataSrc.mapping.column); }; - // Mark sensitivity - $scope._oriItem = {}; - $scope._markItem = {}; - + // =================== Sensitivity =================== $scope.markSensitivity = function(item, event) { if(event) event.stopPropagation(); $scope._oriItem = item; $scope._markItem = { - prefix: "hiveResourceSensitivity", + prefix: $scope.dataSrc.prefix, tags: { site: Site.current().name, - hiveResource: item.resource }, sensitivityType: "" }; - $("#sensitivityHiveMDL").modal(); + $scope._markItem.tags[$scope.dataSrc.keys[0]] = item.resource; + $("#sensitivityMDL").modal(); setTimeout(function() { - $("#hiveSensitiveType").focus(); + $("#sensitiveType").focus(); }, 500); }; $scope.confirmUpateSensitivity = function() { $scope._oriItem.sensitiveType = $scope._markItem.sensitivityType; - var _promise = Entities.updateEntity("HiveResourceSensitivityService", $scope._markItem, {timestamp: false})._promise.success(function(data) { + var _promise = Entities.updateEntity($scope.dataSrc.service, $scope._markItem, {timestamp: false})._promise.success(function(data) { Entities.dialog(data); }); - $("#sensitivityHiveMDL").modal('hide'); + $("#sensitivityMDL").modal('hide'); }; $scope.unmarkSensitivity = function(item, event) { if(event) event.stopPropagation(); @@ -377,10 +433,11 @@ damControllers.controller('sensitivityHiveCtrl', function(globalContent, Site, d }, function(ret) { if(!ret) return; - Entities.deleteEntities("HiveResourceSensitivityService", { + var _qry = { site: Site.current().name, - hiveResource: item.resource - }); + }; + _qry[$scope.dataSrc.keys[0]] = item.resource; + Entities.deleteEntities($scope.dataSrc.service, _qry); item.sensitiveType = null; $scope.$apply();