This is an automated email from the ASF dual-hosted git repository.

ni3galave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 79c2504  RANGER-2392: Create / Update zone to have provision to 
associate Tag based service with zone.
79c2504 is described below

commit 79c2504d1d022ecccfa9ff69e33502bd59c762b5
Author: Nitin Galave <[email protected]>
AuthorDate: Mon Apr 15 18:53:45 2019 +0530

    RANGER-2392: Create / Update zone to have provision to associate Tag based 
service with zone.
---
 .../ranger/plugin/model/RangerSecurityZone.java    |  17 ++-
 .../optimized/current/ranger_core_db_mysql.sql     |  18 +++
 .../patches/037-create-security-zone-schema.sql    |  18 +++
 .../optimized/current/ranger_core_db_oracle.sql    |  21 ++++
 .../patches/037-create-security-zone-schema.sql    |  21 ++++
 .../optimized/current/ranger_core_db_postgres.sql  |  20 ++++
 .../patches/037-create-security-zone-schema.sql    |  20 ++++
 .../current/ranger_core_db_sqlanywhere.sql         |  25 ++++
 .../patches/037-create-security-zone-schema.sql    |  24 ++++
 .../optimized/current/ranger_core_db_sqlserver.sql |  49 ++++++++
 .../patches/037-create-security-zone-schema.sql    |  55 +++++++++
 .../apache/ranger/biz/SecurityZoneRefUpdater.java  |  34 +++++-
 .../org/apache/ranger/common/RangerConstants.java  |   3 +
 .../org/apache/ranger/db/RangerDaoManagerBase.java |   2 +
 .../ranger/db/XXSecurityZoneRefTagServiceDao.java  |  48 ++++++++
 .../ranger/entity/XXSecurityZoneRefTagService.java | 116 ++++++++++++++++++
 .../org/apache/ranger/rest/SecurityZoneREST.java   |   1 +
 .../service/RangerSecurityZoneServiceService.java  |   4 +-
 .../main/resources/META-INF/jpa_named_queries.xml  |   6 +
 .../src/main/webapp/scripts/models/RangerZone.js   |   9 ++
 .../src/main/webapp/scripts/utils/XAUtils.js       |  54 +++++++++
 .../scripts/views/policymanager/ServiceLayout.js   |  40 ++-----
 .../scripts/views/security_zone/SecurityZone.js    |   2 -
 .../views/security_zone/ZoneAdministration.js      |   6 +-
 .../scripts/views/security_zone/ZoneCreate.js      |   1 +
 security-admin/src/main/webapp/styles/xa.css       |  26 ++++-
 .../templates/security_zone/SecurityZone_tmpl.html |  30 ++---
 .../security_zone/ZoneAdministration_tmpl.html     | 130 +++++++++++++--------
 .../security_zone/ZoneCreateForm_tmpl.html         |   8 +-
 29 files changed, 699 insertions(+), 109 deletions(-)

diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java
index 547e2d2..c3e96bf 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java
@@ -40,6 +40,7 @@ public class RangerSecurityZone extends RangerBaseModelObject 
implements java.io
        private static final long serialVersionUID = 1L;
     private String                                  name;
     private Map<String, RangerSecurityZoneService>  services;
+    private List<String>                                                       
tagServices;
     private List<String>                            adminUsers;
     private List<String>                            adminUserGroups;
     private List<String>                            auditUsers;
@@ -47,10 +48,10 @@ public class RangerSecurityZone extends 
RangerBaseModelObject implements java.io
     private String                                  description;
 
     public RangerSecurityZone() {
-        this(null, null, null, null, null, null, null);
+        this(null, null, null, null, null, null, null,null);
     }
 
-    public RangerSecurityZone(String name, Map<String, 
RangerSecurityZoneService> services, List<String> adminUsers, List<String> 
adminUserGroups, List<String> auditUsers, List<String> auditUserGroups, String 
description) {
+    public RangerSecurityZone(String name, Map<String, 
RangerSecurityZoneService> services,List<String> tagServices, List<String> 
adminUsers, List<String> adminUserGroups, List<String> auditUsers, List<String> 
auditUserGroups, String description) {
         setName(name);
         setServices(services);
         setAdminUsers(adminUsers);
@@ -58,6 +59,7 @@ public class RangerSecurityZone extends RangerBaseModelObject 
implements java.io
         setAuditUsers(auditUsers);
         setAuditUserGroups(auditUserGroups);
         setDescription(description);
+        setTagServices(tagServices);
     }
     public String getName() { return name; }
 
@@ -101,10 +103,19 @@ public class RangerSecurityZone extends 
RangerBaseModelObject implements java.io
         this.auditUserGroups = auditUserGroups == null ? new ArrayList<>() : 
auditUserGroups;
     }
 
-    @Override
+    public List<String> getTagServices() {
+                return tagServices;
+        }
+
+        public void setTagServices(List<String> tagServices) {
+                this.tagServices = tagServices;
+        }
+
+        @Override
     public String toString() {
         return    "{name=" + name
                 + ", services=" + services
+                + ", tagServices=" + tagServices
                 + ", adminUsers=" + adminUsers
                 + ", adminUserGroups=" + adminUserGroups
                 + ", auditUsers=" + auditUsers
diff --git a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 
b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
index 0a529b4..707c311 100644
--- a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
+++ b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
@@ -62,6 +62,7 @@ DROP TABLE IF EXISTS `x_policy`;
 DROP TABLE IF EXISTS `x_security_zone_ref_group`;
 DROP TABLE IF EXISTS `x_security_zone_ref_user`;
 DROP TABLE IF EXISTS `x_security_zone_ref_service`;
+DROP TABLE IF EXISTS `x_security_zone_ref_tag_srvc`;
 DROP TABLE IF EXISTS `x_ranger_global_state`;
 DROP TABLE IF EXISTS `x_security_zone`;
 DROP TABLE IF EXISTS `x_service`;
@@ -600,6 +601,23 @@ CREATE TABLE IF NOT EXISTS `x_security_zone_ref_service`(
  CONSTRAINT `x_sz_ref_service_FK_service_name` FOREIGN KEY (`service_name`) 
REFERENCES `x_service` (`name`)
 )ROW_FORMAT=DYNAMIC;
 
+CREATE TABLE IF NOT EXISTS `x_security_zone_ref_tag_srvc`(
+`id` bigint(20) NOT NULL AUTO_INCREMENT,
+`create_time` datetime NULL DEFAULT NULL,
+`update_time` datetime NULL DEFAULT NULL,
+`added_by_id` bigint(20) NULL DEFAULT NULL,
+`upd_by_id` bigint(20) NULL DEFAULT NULL,
+`zone_id` bigint(20) NULL DEFAULT NULL,
+`tag_srvc_id` bigint(20) NULL DEFAULT NULL,
+`tag_srvc_name` varchar(255) NULL DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_added_by_id` FOREIGN KEY (`added_by_id`) 
REFERENCES `x_portal_user` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) 
REFERENCES `x_portal_user` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_zone_id` FOREIGN KEY (`zone_id`) 
REFERENCES `x_security_zone` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_tag_srvc_id` FOREIGN KEY (`tag_srvc_id`) 
REFERENCES `x_service` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_tag_srvc_name` FOREIGN KEY 
(`tag_srvc_name`) REFERENCES `x_service` (`name`)
+)ROW_FORMAT=DYNAMIC;
+
 CREATE TABLE IF NOT EXISTS `x_security_zone_ref_user`(
 `id` bigint(20) NOT NULL AUTO_INCREMENT,
 `create_time` datetime NULL DEFAULT NULL,
diff --git 
a/security-admin/db/mysql/patches/037-create-security-zone-schema.sql 
b/security-admin/db/mysql/patches/037-create-security-zone-schema.sql
index aff9786..a50ec0e 100644
--- a/security-admin/db/mysql/patches/037-create-security-zone-schema.sql
+++ b/security-admin/db/mysql/patches/037-create-security-zone-schema.sql
@@ -58,6 +58,7 @@ DROP TABLE IF EXISTS `x_security_zone_ref_group`;
 DROP TABLE IF EXISTS `x_security_zone_ref_user`;
 DROP TABLE IF EXISTS `x_security_zone_ref_resource`;
 DROP TABLE IF EXISTS `x_security_zone_ref_service`;
+DROP TABLE IF EXISTS `x_security_zone_ref_tag_srvc`;
 DROP TABLE IF EXISTS `x_ranger_global_state`;
 DROP TABLE IF EXISTS `x_security_zone`;
 
@@ -109,6 +110,23 @@ CREATE TABLE IF NOT EXISTS `x_security_zone_ref_service`(
  CONSTRAINT `x_sz_ref_service_FK_service_name` FOREIGN KEY (`service_name`) 
REFERENCES `x_service` (`name`)
 )ROW_FORMAT=DYNAMIC;
 
+CREATE TABLE IF NOT EXISTS `x_security_zone_ref_tag_srvc`(
+`id` bigint(20) NOT NULL AUTO_INCREMENT,
+`create_time` datetime NULL DEFAULT NULL,
+`update_time` datetime NULL DEFAULT NULL,
+`added_by_id` bigint(20) NULL DEFAULT NULL,
+`upd_by_id` bigint(20) NULL DEFAULT NULL,
+`zone_id` bigint(20) NULL DEFAULT NULL,
+`tag_srvc_id` bigint(20) NULL DEFAULT NULL,
+`tag_srvc_name` varchar(255) NULL DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_added_by_id` FOREIGN KEY (`added_by_id`) 
REFERENCES `x_portal_user` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) 
REFERENCES `x_portal_user` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_zone_id` FOREIGN KEY (`zone_id`) 
REFERENCES `x_security_zone` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_tag_service_id` FOREIGN KEY 
(`tag_srvc_id`) REFERENCES `x_service` (`id`),
+ CONSTRAINT `x_sz_ref_tag_service_FK_tag_service_name` FOREIGN KEY 
(`tag_srvc_name`) REFERENCES `x_service` (`name`)
+)ROW_FORMAT=DYNAMIC;
+
 CREATE TABLE IF NOT EXISTS `x_security_zone_ref_resource`(
 `id` bigint(20) NOT NULL AUTO_INCREMENT,
 `create_time` datetime NULL DEFAULT NULL,
diff --git 
a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 
b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
index 9be7e8d..e7d8989 100644
--- a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
+++ b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
@@ -88,6 +88,7 @@ call spdropsequence('X_SEC_ZONE_REF_GROUP_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_USER_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_RESOURCE_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_SERVICE_SEQ');
+call spdropsequence('X_SEC_ZONE_REF_TAG_SRVC_SEQ');
 call spdropsequence('X_RANGER_GLOBAL_STATE_SEQ');
 call spdropsequence('X_SECURITY_ZONE_SEQ');
 call spdropsequence('X_POLICY_CHANGE_LOG_SEQ');
@@ -154,6 +155,7 @@ CREATE SEQUENCE X_UGSYNC_AUDIT_INFO_SEQ START WITH 1 
INCREMENT BY 1 NOCACHE NOCY
 CREATE SEQUENCE X_SECURITY_ZONE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_RANGER_GLOBAL_STATE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_SERVICE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
+CREATE SEQUENCE X_SEC_ZONE_REF_TAG_SRVC_SEQ START WITH 1 INCREMENT BY 1 
NOCACHE NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_RESOURCE_SEQ START WITH 1 INCREMENT BY 1 
NOCACHE NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_USER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_GROUP_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
@@ -234,6 +236,7 @@ call spdroptable('x_policy');
 call spdroptable('x_security_zone_ref_group');
 call spdroptable('x_security_zone_ref_user');
 call spdroptable('x_security_zone_ref_service');
+call spdroptable('x_security_zone_ref_tag_srvc');
 call spdroptable('x_ranger_global_state');
 call spdroptable('x_security_zone');
 call spdroptable('x_service');
@@ -685,6 +688,24 @@ CONSTRAINT x_sz_ref_ser_FK_service_name FOREIGN KEY 
(service_name) REFERENCES x_
 );
 commit;
 
+CREATE TABLE x_security_zone_ref_tag_srvc (
+id NUMBER(20) NOT NULL,
+create_time DATE DEFAULT NULL NULL,
+update_time DATE DEFAULT NULL NULL,
+added_by_id NUMBER(20) DEFAULT NULL NULL,
+upd_by_id NUMBER(20) DEFAULT NULL NULL,
+zone_id NUMBER(20)  DEFAULT NULL NULL,
+tag_srvc_id NUMBER(20)  DEFAULT NULL NULL,
+tag_srvc_name VARCHAR(255) DEFAULT NULL NULL,
+primary key (id),
+CONSTRAINT x_sz_refTagTser_FK_aded_by_id FOREIGN KEY (added_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagTser_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagTser_FK_zone_id FOREIGN KEY (zone_id) REFERENCES 
x_security_zone (id),
+CONSTRAINT x_sz_refTagTser_FK_srvc_id FOREIGN KEY (tag_srvc_id) REFERENCES 
x_service (id),
+CONSTRAINT x_sz_refTagTser_FK_srvc_name FOREIGN KEY (tag_srvc_name) REFERENCES 
x_service (name)
+);
+commit;
+
 CREATE TABLE x_security_zone_ref_user (
 id NUMBER(20) NOT NULL,
 create_time DATE DEFAULT NULL NULL,
diff --git 
a/security-admin/db/oracle/patches/037-create-security-zone-schema.sql 
b/security-admin/db/oracle/patches/037-create-security-zone-schema.sql
index aae31dc..354c74d 100644
--- a/security-admin/db/oracle/patches/037-create-security-zone-schema.sql
+++ b/security-admin/db/oracle/patches/037-create-security-zone-schema.sql
@@ -60,12 +60,14 @@ call spdropsequence('X_SEC_ZONE_REF_GROUP_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_USER_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_RESOURCE_SEQ');
 call spdropsequence('X_SEC_ZONE_REF_SERVICE_SEQ');
+call spdropsequence('X_SEC_ZONE_REF_TAG_SRVC_SEQ');
 call spdropsequence('X_RANGER_GLOBAL_STATE_SEQ');
 call spdropsequence('X_SECURITY_ZONE_SEQ');
 
 CREATE SEQUENCE X_SECURITY_ZONE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_RANGER_GLOBAL_STATE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_SERVICE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
+CREATE SEQUENCE X_SEC_ZONE_REF_TAG_SRVC_SEQ START WITH 1 INCREMENT BY 1 
NOCACHE NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_RESOURCE_SEQ START WITH 1 INCREMENT BY 1 
NOCACHE NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_USER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 CREATE SEQUENCE X_SEC_ZONE_REF_GROUP_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
@@ -74,6 +76,7 @@ call spdroptable('x_security_zone_ref_resource');
 call spdroptable('x_security_zone_ref_group');
 call spdroptable('x_security_zone_ref_user');
 call spdroptable('x_security_zone_ref_service');
+call spdroptable('x_security_zone_ref_tag_srvc');
 call spdroptable('x_ranger_global_state');
 call spdroptable('x_security_zone');
 
@@ -129,6 +132,24 @@ CONSTRAINT x_sz_ref_ser_FK_service_name FOREIGN KEY 
(service_name) REFERENCES x_
 );
 commit;
 
+CREATE TABLE x_security_zone_ref_tag_srvc (
+id NUMBER(20) NOT NULL,
+create_time DATE DEFAULT NULL NULL,
+update_time DATE DEFAULT NULL NULL,
+added_by_id NUMBER(20) DEFAULT NULL NULL,
+upd_by_id NUMBER(20) DEFAULT NULL NULL,
+zone_id NUMBER(20)  DEFAULT NULL NULL,
+tag_srvc_id NUMBER(20)  DEFAULT NULL NULL,
+tag_srvc_name VARCHAR(255) DEFAULT NULL NULL,
+primary key (id),
+CONSTRAINT x_sz_refTagTser_FK_aded_by_id FOREIGN KEY (added_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagTser_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagTser_FK_zone_id FOREIGN KEY (zone_id) REFERENCES 
x_security_zone (id),
+CONSTRAINT x_sz_refTagTser_FK_srvc_id FOREIGN KEY (tag_srvc_id) REFERENCES 
x_service (id),
+CONSTRAINT x_sz_refTagTser_FK_srvc_name FOREIGN KEY (tag_srvc_name) REFERENCES 
x_service (name)
+);
+commit;
+
 CREATE TABLE x_security_zone_ref_resource (
 id NUMBER(20) NOT NULL,
 create_time DATE DEFAULT NULL NULL,
diff --git 
a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 
b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
index ec39c32..a1998fc 100644
--- a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
+++ b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
@@ -61,6 +61,7 @@ DROP TABLE IF EXISTS x_policy CASCADE;
 DROP TABLE IF EXISTS x_security_zone_ref_group CASCADE;
 DROP TABLE IF EXISTS x_security_zone_ref_user CASCADE;
 DROP TABLE IF EXISTS x_security_zone_ref_service CASCADE;
+DROP TABLE IF EXISTS x_security_zone_ref_tag_srvc CASCADE;
 DROP TABLE IF EXISTS x_ranger_global_state CASCADE;
 DROP TABLE IF EXISTS x_security_zone CASCADE;
 DROP TABLE IF EXISTS x_service CASCADE;
@@ -87,6 +88,7 @@ DROP SEQUENCE IF EXISTS x_sec_zone_ref_group_seq;
 DROP SEQUENCE IF EXISTS x_sec_zone_ref_user_seq;
 DROP SEQUENCE IF EXISTS x_sec_zone_ref_resource_seq;
 DROP SEQUENCE IF EXISTS x_sec_zone_ref_service_seq;
+DROP SEQUENCE IF EXISTS x_sec_zone_ref_tag_srvc_SEQ;
 DROP SEQUENCE IF EXISTS x_ranger_global_state_seq;
 DROP SEQUENCE IF EXISTS x_security_zone_seq;
 DROP SEQUENCE IF EXISTS x_policy_change_log_seq;
@@ -1355,6 +1357,24 @@ CONSTRAINT x_sz_ref_service_FK_service_id FOREIGN KEY 
(service_id) REFERENCES x_
 CONSTRAINT x_sz_ref_service_FK_service_name FOREIGN KEY (service_name) 
REFERENCES x_service (name)
 );
 
+CREATE SEQUENCE x_sec_zone_ref_tag_srvc_seq;
+CREATE TABLE x_security_zone_ref_tag_srvc (
+id BIGINT DEFAULT nextval('x_sec_zone_ref_tag_srvc_SEQ'::regclass),
+create_time TIMESTAMP DEFAULT NULL NULL,
+update_time TIMESTAMP DEFAULT NULL NULL,
+added_by_id BIGINT DEFAULT NULL NULL,
+upd_by_id BIGINT DEFAULT NULL NULL,
+zone_id BIGINT DEFAULT NULL NULL,
+tag_srvc_id BIGINT DEFAULT NULL NULL,
+tag_srvc_name varchar(255) NULL DEFAULT NULL::character varying,
+primary key (id),
+CONSTRAINT x_sz_refTagSrvc_FK_aded_by_id FOREIGN KEY (added_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagSrvc_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagSrvc_FK_zone_id FOREIGN KEY (zone_id) REFERENCES 
x_security_zone (id),
+CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_id FOREIGN KEY (tag_srvc_id) REFERENCES 
x_service (id),
+CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_name FOREIGN KEY (tag_srvc_name) 
REFERENCES x_service (name)
+);
+
 CREATE SEQUENCE x_sec_zone_ref_resource_seq;
 CREATE TABLE x_security_zone_ref_resource (
 id BIGINT DEFAULT nextval('x_sec_zone_ref_resource_seq'::regclass),
diff --git 
a/security-admin/db/postgres/patches/037-create-security-zone-schema.sql 
b/security-admin/db/postgres/patches/037-create-security-zone-schema.sql
index 4a94d26..434231d 100644
--- a/security-admin/db/postgres/patches/037-create-security-zone-schema.sql
+++ b/security-admin/db/postgres/patches/037-create-security-zone-schema.sql
@@ -70,6 +70,8 @@ DROP TABLE IF EXISTS x_security_zone_ref_resource CASCADE;
 DROP SEQUENCE IF EXISTS x_sec_zone_ref_resource_seq;
 DROP TABLE IF EXISTS x_security_zone_ref_service CASCADE;
 DROP SEQUENCE IF EXISTS x_sec_zone_ref_service_seq;
+DROP TABLE IF EXISTS x_security_zone_ref_tag_srvc CASCADE;
+DROP SEQUENCE IF EXISTS x_sec_zone_ref_tag_srvc_seq;
 DROP TABLE IF EXISTS x_ranger_global_state CASCADE;
 DROP SEQUENCE IF EXISTS x_ranger_global_state_seq;
 DROP TABLE IF EXISTS x_security_zone CASCADE;
@@ -126,6 +128,24 @@ CONSTRAINT x_sz_ref_service_FK_service_id FOREIGN KEY 
(service_id) REFERENCES x_
 CONSTRAINT x_sz_ref_service_FK_service_name FOREIGN KEY (service_name) 
REFERENCES x_service (name)
 );
 
+CREATE SEQUENCE x_sec_zone_ref_tag_srvc_seq;
+CREATE TABLE x_security_zone_ref_tag_srvc (
+id BIGINT DEFAULT nextval('x_sec_zone_ref_tag_srvc_SEQ'::regclass),
+create_time TIMESTAMP DEFAULT NULL NULL,
+update_time TIMESTAMP DEFAULT NULL NULL,
+added_by_id BIGINT DEFAULT NULL NULL,
+upd_by_id BIGINT DEFAULT NULL NULL,
+zone_id BIGINT DEFAULT NULL NULL,
+tag_srvc_id BIGINT DEFAULT NULL NULL,
+tag_srvc_name varchar(255) NULL DEFAULT NULL::character varying,
+primary key (id),
+CONSTRAINT x_sz_refTagSrvc_FK_aded_by_id FOREIGN KEY (added_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagSrvc_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES 
x_portal_user (id),
+CONSTRAINT x_sz_refTagSrvc_FK_zone_id FOREIGN KEY (zone_id) REFERENCES 
x_security_zone (id),
+CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_id FOREIGN KEY (tag_srvc_id) REFERENCES 
x_service (id),
+CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_name FOREIGN KEY (tag_srvc_name) 
REFERENCES x_service (name)
+);
+
 CREATE SEQUENCE x_sec_zone_ref_resource_seq;
 CREATE TABLE x_security_zone_ref_resource (
 id BIGINT DEFAULT nextval('x_sec_zone_ref_resource_seq'::regclass),
diff --git 
a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
 
b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
index abfe120..207c5a3 100644
--- 
a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
+++ 
b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
@@ -36,6 +36,7 @@ BEGIN
 END
 GO
 call dbo.removeForeignKeysAndTable('x_security_zone_ref_resource')
+GO
 call dbo.removeForeignKeysAndTable('x_policy_change_log')
 GO
 call dbo.removeForeignKeysAndTable('x_policy_ref_group')
@@ -130,6 +131,8 @@ call 
dbo.removeForeignKeysAndTable('x_security_zone_ref_user')
 GO
 call dbo.removeForeignKeysAndTable('x_security_zone_ref_service')
 GO
+call dbo.removeForeignKeysAndTable('x_security_zone_ref_tag_srvc')
+GO
 call dbo.removeForeignKeysAndTable('x_ranger_global_state')
 GO
 call dbo.removeForeignKeysAndTable('x_security_zone')
@@ -1140,6 +1143,18 @@ CREATE TABLE dbo.x_security_zone_ref_service(
         CONSTRAINT x_sz_ref_service_PK_id PRIMARY KEY CLUSTERED(id)
 )
 GO
+CREATE TABLE dbo.x_security_zone_ref_tag_srvc(
+        id bigint IDENTITY NOT NULL,
+        create_time datetime DEFAULT NULL NULL,
+        update_time datetime DEFAULT NULL NULL,
+        added_by_id bigint DEFAULT NULL NULL,
+        upd_by_id bigint DEFAULT NULL NULL,
+        zone_id bigint DEFAULT NULL NULL,
+        tag_srvc_id bigint DEFAULT NULL NULL,
+        tag_srvc_name varchar(255) DEFAULT NULL NULL,
+        CONSTRAINT x_sz_ref_tag_service_PK_id PRIMARY KEY CLUSTERED(id)
+)
+GO
 CREATE TABLE dbo.x_security_zone_ref_resource(
         id bigint IDENTITY NOT NULL,
         create_time datetime DEFAULT NULL NULL,
@@ -1542,6 +1557,16 @@ ALTER TABLE dbo.x_security_zone_ref_service ADD 
CONSTRAINT x_sz_ref_service_FK_s
 GO
 ALTER TABLE dbo.x_security_zone_ref_service ADD CONSTRAINT 
x_sz_ref_service_FK_service_name FOREIGN KEY(service_name) REFERENCES 
dbo.x_service (name)
 GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES 
dbo.x_portal_user (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES 
dbo.x_portal_user (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_zone_id FOREIGN KEY(zone_id) REFERENCES 
dbo.x_security_zone (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_id FOREIGN KEY(tag_service_id) REFERENCES 
dbo.x_service (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_name FOREIGN KEY(tag_service_name) 
REFERENCES dbo.x_service (name)
+GO
 ALTER TABLE dbo.x_security_zone_ref_resource ADD CONSTRAINT 
x_sz_ref_resource_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES 
dbo.x_portal_user (id)
 GO
 ALTER TABLE dbo.x_security_zone_ref_resource ADD CONSTRAINT 
x_sz_ref_resource_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES 
dbo.x_portal_user (id)
diff --git 
a/security-admin/db/sqlanywhere/patches/037-create-security-zone-schema.sql 
b/security-admin/db/sqlanywhere/patches/037-create-security-zone-schema.sql
index 5b7dade..893d453 100644
--- a/security-admin/db/sqlanywhere/patches/037-create-security-zone-schema.sql
+++ b/security-admin/db/sqlanywhere/patches/037-create-security-zone-schema.sql
@@ -48,6 +48,8 @@ call dbo.removeForeignKeysAndTable('x_security_zone_ref_user')
 GO
 call dbo.removeForeignKeysAndTable('x_security_zone_ref_service')
 GO
+call dbo.removeForeignKeysAndTable('x_security_zone_ref_tag_srvc')
+GO
 call dbo.removeForeignKeysAndTable('x_ranger_global_state')
 GO
 call dbo.removeForeignKeysAndTable('x_security_zone')
@@ -116,6 +118,28 @@ ALTER TABLE dbo.x_security_zone_ref_service ADD CONSTRAINT 
x_sz_ref_service_FK_s
 GO
 ALTER TABLE dbo.x_security_zone_ref_service ADD CONSTRAINT 
x_sz_ref_service_FK_service_name FOREIGN KEY(service_name) REFERENCES 
dbo.x_service (name)
 GO
+CREATE TABLE dbo.x_security_zone_ref_tag_srvc(
+        id bigint IDENTITY NOT NULL,
+        create_time datetime DEFAULT NULL NULL,
+        update_time datetime DEFAULT NULL NULL,
+        added_by_id bigint DEFAULT NULL NULL,
+        upd_by_id bigint DEFAULT NULL NULL,
+        zone_id bigint DEFAULT NULL NULL,
+        tag_srvc_id bigint DEFAULT NULL NULL,
+        tag_srvc_name varchar(255) DEFAULT NULL NULL,
+        CONSTRAINT x_sz_ref_tag_srvc_PK_id PRIMARY KEY CLUSTERED(id)
+)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES 
dbo.x_portal_user (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES 
dbo.x_portal_user (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_zone_id FOREIGN KEY(zone_id) REFERENCES 
dbo.x_security_zone (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_id FOREIGN KEY(tag_srvc_id) REFERENCES 
dbo.x_service (id)
+GO
+ALTER TABLE dbo.x_security_zone_ref_tag_srvc ADD CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_name FOREIGN KEY(tag_srvc_name) REFERENCES 
dbo.x_service (name)
+GO
 CREATE TABLE dbo.x_security_zone_ref_resource(
         id bigint IDENTITY NOT NULL,
         create_time datetime DEFAULT NULL NULL,
diff --git 
a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 
b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
index 1e8dff9..36aefcf 100644
--- a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
+++ b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
@@ -581,6 +581,26 @@ IF (OBJECT_ID('x_sz_ref_service_FK_service_name') IS NOT 
NULL)
 BEGIN
     ALTER TABLE [dbo].[x_security_zone_ref_service] DROP CONSTRAINT 
x_sz_ref_service_FK_service_name
 END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_added_by_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_added_by_id
+END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_upd_by_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_upd_by_id
+END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_zone_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_zone_id
+END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_tag_service_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_id
+END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_tag_service_name') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_name
+END
 IF (OBJECT_ID('x_ranger_global_state_FK_upd_by_id') IS NOT NULL)
 BEGIN
     ALTER TABLE [dbo].[x_ranger_global_state] DROP CONSTRAINT 
x_ranger_global_state_FK_upd_by_id
@@ -789,6 +809,10 @@ IF (OBJECT_ID('x_security_zone_ref_service') IS NOT NULL)
 BEGIN
     DROP TABLE [dbo].[x_security_zone_ref_service]
 END
+IF (OBJECT_ID('x_security_zone_ref_tag_srvc') IS NOT NULL)
+BEGIN
+    DROP TABLE [dbo].[x_security_zone_ref_tag_srvc]
+END
 IF (OBJECT_ID('x_security_zone_ref_resource') IS NOT NULL)
 BEGIN
     DROP TABLE [dbo].[x_security_zone_ref_resource]
@@ -2238,6 +2262,31 @@ ALTER TABLE [dbo].[x_security_zone_ref_service] WITH 
CHECK ADD CONSTRAINT [x_sz_
 GO
 ALTER TABLE [dbo].[x_security_zone_ref_service] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_service_FK_service_name] FOREIGN KEY([service_name]) REFERENCES 
[dbo].[x_service] ([name])
 GO
+CREATE TABLE [dbo].[x_security_zone_ref_tag_srvc](
+        [id] [bigint] IDENTITY(1,1) NOT NULL,
+        [create_time] [datetime2] DEFAULT NULL NULL,
+        [update_time] [datetime2] DEFAULT NULL NULL,
+        [added_by_id] [bigint] DEFAULT NULL NULL,
+        [upd_by_id] [bigint] DEFAULT NULL NULL,
+        [zone_id] [bigint] DEFAULT NULL NULL,
+        [tag_srvc_id] [bigint] DEFAULT NULL NULL,
+        [tag_srvc_name] [varchar](255) DEFAULT NULL NULL,
+        PRIMARY KEY CLUSTERED
+(
+        [id] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
+) ON [PRIMARY]
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_added_by_id] FOREIGN KEY([added_by_id]) REFERENCES 
[dbo].[x_portal_user] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_upd_by_id] FOREIGN KEY([upd_by_id]) REFERENCES 
[dbo].[x_portal_user] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_zone_id] FOREIGN KEY([zone_id]) REFERENCES 
[dbo].[x_security_zone] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_tag_srvc_id] FOREIGN KEY([tag_srvc_id]) REFERENCES 
[dbo].[x_service] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_tag_srvc_name] FOREIGN KEY([tag_srvc_name]) REFERENCES 
[dbo].[x_service] ([name])
+GO
 SET ANSI_NULLS ON
 SET QUOTED_IDENTIFIER ON
 SET ANSI_PADDING ON
diff --git 
a/security-admin/db/sqlserver/patches/037-create-security-zone-schema.sql 
b/security-admin/db/sqlserver/patches/037-create-security-zone-schema.sql
index e621b43..a610b70 100644
--- a/security-admin/db/sqlserver/patches/037-create-security-zone-schema.sql
+++ b/security-admin/db/sqlserver/patches/037-create-security-zone-schema.sql
@@ -112,6 +112,31 @@ IF (OBJECT_ID('x_sz_ref_service_FK_service_name') IS NOT 
NULL)
 BEGIN
     ALTER TABLE [dbo].[x_security_zone_ref_service] DROP CONSTRAINT 
x_sz_ref_service_FK_service_name
 END
+GO
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_added_by_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_added_by_id
+END
+GO
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_upd_by_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_upd_by_id
+END
+GO
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_zone_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_zone_id
+END
+GO
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_tag_service_id') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_id
+END
+IF (OBJECT_ID('x_sz_ref_tag_service_FK_tag_service_name') IS NOT NULL)
+BEGIN
+    ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] DROP CONSTRAINT 
x_sz_ref_tag_service_FK_tag_service_name
+END
+GO
 IF (OBJECT_ID('x_ranger_global_state_FK_upd_by_id') IS NOT NULL)
 BEGIN
     ALTER TABLE [dbo].[x_ranger_global_state] DROP CONSTRAINT 
x_ranger_global_state_FK_upd_by_id
@@ -137,6 +162,11 @@ BEGIN
     DROP TABLE [dbo].[x_security_zone_ref_service]
 END
 GO
+IF (OBJECT_ID('x_security_zone_ref_tag_srvc') IS NOT NULL)
+BEGIN
+    DROP TABLE [dbo].[x_security_zone_ref_tag_srvc]
+END
+GO
 IF (OBJECT_ID('x_security_zone_ref_resource') IS NOT NULL)
 BEGIN
     DROP TABLE [dbo].[x_security_zone_ref_resource]
@@ -226,6 +256,31 @@ ALTER TABLE [dbo].[x_security_zone_ref_service] WITH CHECK 
ADD CONSTRAINT [x_sz_
 GO
 ALTER TABLE [dbo].[x_security_zone_ref_service] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_service_FK_service_name] FOREIGN KEY([service_name]) REFERENCES 
[dbo].[x_service] ([name])
 GO
+CREATE TABLE [dbo].[x_security_zone_ref_tag_srvc](
+        [id] [bigint] IDENTITY(1,1) NOT NULL,
+        [create_time] [datetime2] DEFAULT NULL NULL,
+        [update_time] [datetime2] DEFAULT NULL NULL,
+        [added_by_id] [bigint] DEFAULT NULL NULL,
+        [upd_by_id] [bigint] DEFAULT NULL NULL,
+        [zone_id] [bigint] DEFAULT NULL NULL,
+        [tag_srvc_id] [bigint] DEFAULT NULL NULL,
+        [tag_srvc_name] [varchar](255) DEFAULT NULL NULL,
+        PRIMARY KEY CLUSTERED
+(
+        [id] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
+) ON [PRIMARY]
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_added_by_id] FOREIGN KEY([added_by_id]) REFERENCES 
[dbo].[x_portal_user] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_upd_by_id] FOREIGN KEY([upd_by_id]) REFERENCES 
[dbo].[x_portal_user] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_zone_id] FOREIGN KEY([zone_id]) REFERENCES 
[dbo].[x_security_zone] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_tag_service_id] FOREIGN KEY([tag_srvc_id]) REFERENCES 
[dbo].[x_service] ([id])
+GO
+ALTER TABLE [dbo].[x_security_zone_ref_tag_srvc] WITH CHECK ADD CONSTRAINT 
[x_sz_ref_tag_service_FK_tag_service_name] FOREIGN KEY([tag_srvc_name]) 
REFERENCES [dbo].[x_service] ([name])
+GO
 SET ANSI_NULLS ON
 SET QUOTED_IDENTIFIER ON
 SET ANSI_PADDING ON
diff --git 
a/security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneRefUpdater.java
 
b/security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneRefUpdater.java
index 2b0c462..a6f5533 100644
--- 
a/security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneRefUpdater.java
+++ 
b/security-admin/src/main/java/org/apache/ranger/biz/SecurityZoneRefUpdater.java
@@ -28,16 +28,19 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.ranger.common.MessageEnums;
 import org.apache.ranger.common.RESTErrorUtil;
+import org.apache.ranger.common.RangerConstants;
 import org.apache.ranger.db.RangerDaoManager;
 import org.apache.ranger.db.XXSecurityZoneRefGroupDao;
 import org.apache.ranger.db.XXSecurityZoneRefResourceDao;
 import org.apache.ranger.db.XXSecurityZoneRefServiceDao;
+import org.apache.ranger.db.XXSecurityZoneRefTagServiceDao;
 import org.apache.ranger.db.XXSecurityZoneRefUserDao;
 import org.apache.ranger.entity.XXGroup;
 import org.apache.ranger.entity.XXResourceDef;
 import org.apache.ranger.entity.XXSecurityZoneRefGroup;
 import org.apache.ranger.entity.XXSecurityZoneRefResource;
 import org.apache.ranger.entity.XXSecurityZoneRefService;
+import org.apache.ranger.entity.XXSecurityZoneRefTagService;
 import org.apache.ranger.entity.XXSecurityZoneRefUser;
 import org.apache.ranger.entity.XXService;
 import org.apache.ranger.entity.XXServiceDef;
@@ -80,13 +83,14 @@ public class SecurityZoneRefUpdater {
                final Set<String> adminUserGroups = new HashSet<>();
                final Set<String> auditUsers = new HashSet<>();
                final Set<String> auditUserGroups = new HashSet<>();
-
+                final Set<String> tagServices = new HashSet<>();
                XXServiceDef xServiceDef = new XXServiceDef();
 
                adminUsers.addAll(rangerSecurityZone.getAdminUsers());
                adminUserGroups.addAll(rangerSecurityZone.getAdminUserGroups());
                auditUsers.addAll(rangerSecurityZone.getAuditUsers());
                auditUserGroups.addAll(rangerSecurityZone.getAuditUserGroups());
+                tagServices.addAll(rangerSecurityZone.getTagServices());
                for(Map.Entry<String, RangerSecurityZoneService> service : 
zoneServices.entrySet()) {
                        String serviceName = service.getKey();
 
@@ -126,6 +130,29 @@ public class SecurityZoneRefUpdater {
                        }
                }
 
+                if(CollectionUtils.isNotEmpty(tagServices)) {
+                        for(String tagService : tagServices) {
+
+                                if (StringUtils.isBlank(tagService)) {
+                                        continue;
+                                }
+
+                                XXService xService = 
daoMgr.getXXService().findByName(tagService);
+                                if (xService == null || xService.getType() != 
RangerConstants.TAG_SERVICE_TYPE) {
+                                        throw 
restErrorUtil.createRESTException("Tag Service named: " + tagService + " does 
not exist ",
+                                                        
MessageEnums.INVALID_INPUT_DATA);
+                                }
+
+                                XXSecurityZoneRefTagService xZoneTagService = 
rangerAuditFields.populateAuditFieldsForCreate(new 
XXSecurityZoneRefTagService());
+
+                                xZoneTagService.setZoneId(zoneId);
+                                
xZoneTagService.setTagServiceId(xService.getId());
+                                
xZoneTagService.setTagServiceName(xService.getName());
+
+                                
daoMgr.getXXSecurityZoneRefTagService().create(xZoneTagService);
+                        }
+                }
+
                if(CollectionUtils.isNotEmpty(adminUsers)) {
                        for(String adminUser : adminUsers) {
 
@@ -235,6 +262,7 @@ public class SecurityZoneRefUpdater {
                }
 
                XXSecurityZoneRefServiceDao     xZoneServiceDao      = 
daoMgr.getXXSecurityZoneRefService();
+                XXSecurityZoneRefTagServiceDao     xZoneTagServiceDao      = 
daoMgr.getXXSecurityZoneRefTagService();
                XXSecurityZoneRefResourceDao        xZoneResourceDao    = 
daoMgr.getXXSecurityZoneRefResource();
                XXSecurityZoneRefUserDao         xZoneUserDao     = 
daoMgr.getXXSecurityZoneRefUser();
                XXSecurityZoneRefGroupDao   xZoneGroupDao   = 
daoMgr.getXXSecurityZoneRefGroup();
@@ -243,6 +271,10 @@ public class SecurityZoneRefUpdater {
                        xZoneServiceDao.remove(service);
                }
 
+                for (XXSecurityZoneRefTagService service : 
xZoneTagServiceDao.findByZoneId(zoneId)) {
+                        xZoneTagServiceDao.remove(service);
+                }
+
                for(XXSecurityZoneRefResource resource : 
xZoneResourceDao.findByZoneId(zoneId)) {
                        xZoneResourceDao.remove(resource);
                }
diff --git 
a/security-admin/src/main/java/org/apache/ranger/common/RangerConstants.java 
b/security-admin/src/main/java/org/apache/ranger/common/RangerConstants.java
index cdb5e11..17d74d5 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/RangerConstants.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/RangerConstants.java
@@ -174,6 +174,9 @@ public class RangerConstants extends RangerCommonEnums {
        public static final int EMAIL_TYPE_USER_ROLE_UPDATED = 9;
        public static final int EMAIL_TYPE_USER_GRP_ADD = 10;
 
+        //Constant for Tag_Service Type.
+        public final static int TAG_SERVICE_TYPE = 100;
+
        public static final List<String> VALID_USER_ROLE_LIST = new 
ArrayList<String>(Arrays.asList(RangerConstants.ROLE_USER,
                        RangerConstants.ROLE_SYS_ADMIN, 
RangerConstants.ROLE_KEY_ADMIN, RangerConstants.ROLE_ADMIN_AUDITOR,
                        RangerConstants.ROLE_KEY_ADMIN_AUDITOR));
diff --git 
a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java 
b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
index 3599cf3..979fd65 100644
--- 
a/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
+++ 
b/security-admin/src/main/java/org/apache/ranger/db/RangerDaoManagerBase.java
@@ -293,6 +293,8 @@ public abstract class RangerDaoManagerBase {
 
        public XXSecurityZoneRefServiceDao getXXSecurityZoneRefService() { 
return new XXSecurityZoneRefServiceDao(this); }
 
+        public XXSecurityZoneRefTagServiceDao getXXSecurityZoneRefTagService() 
{ return new XXSecurityZoneRefTagServiceDao(this); }
+
        public XXSecurityZoneRefResourceDao getXXSecurityZoneRefResource() { 
return new XXSecurityZoneRefResourceDao(this); }
 
        public XXSecurityZoneRefUserDao getXXSecurityZoneRefUser() { return new 
XXSecurityZoneRefUserDao(this); }
diff --git 
a/security-admin/src/main/java/org/apache/ranger/db/XXSecurityZoneRefTagServiceDao.java
 
b/security-admin/src/main/java/org/apache/ranger/db/XXSecurityZoneRefTagServiceDao.java
new file mode 100644
index 0000000..8006272
--- /dev/null
+++ 
b/security-admin/src/main/java/org/apache/ranger/db/XXSecurityZoneRefTagServiceDao.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ranger.db;
+
+import java.util.List;
+
+import javax.persistence.NoResultException;
+
+import org.apache.ranger.common.db.BaseDao;
+import org.apache.ranger.entity.XXSecurityZoneRefTagService;
+
+public class XXSecurityZoneRefTagServiceDao extends 
BaseDao<XXSecurityZoneRefTagService>{
+
+        public XXSecurityZoneRefTagServiceDao(RangerDaoManagerBase daoManager) 
{
+                super(daoManager);
+        }
+
+        public List<XXSecurityZoneRefTagService> findByZoneId(Long zoneId) {
+        if (zoneId == null) {
+            return null;
+        }
+        try {
+               List<XXSecurityZoneRefTagService> xxZoneRefTagService = 
getEntityManager()
+                    
.createNamedQuery("XXSecurityZoneRefTagService.findByZoneId", tClass)
+                    .setParameter("zoneId", zoneId)
+                    .getResultList();
+            return xxZoneRefTagService;
+        } catch (NoResultException e) {
+            return null;
+        }
+    }
+}
diff --git 
a/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java
 
b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java
new file mode 100644
index 0000000..c67a464
--- /dev/null
+++ 
b/security-admin/src/main/java/org/apache/ranger/entity/XXSecurityZoneRefTagService.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ranger.entity;
+
+import java.util.Objects;
+
+import javax.persistence.Cacheable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+import javax.xml.bind.annotation.XmlRootElement;
+@Entity
+@Cacheable
+@XmlRootElement
+@Table(name = "x_security_zone_ref_tag_srvc")
+public class XXSecurityZoneRefTagService extends XXDBBase implements 
java.io.Serializable{
+        private static final long serialVersionUID = 1L;
+       @Id
+    @SequenceGenerator(name = "x_sec_zone_ref_tag_srvc_SEQ", sequenceName = 
"x_sec_zone_ref_tag_srvc_SEQ", allocationSize = 1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = 
"x_sec_zone_ref_tag_srvc_SEQ")
+    @Column(name = "id")
+    protected Long id;
+
+       @Column(name = "zone_id")
+        protected Long zoneId;
+
+       @Column(name = "tag_srvc_id")
+        protected Long tagServiceId;
+
+       @Column(name = "tag_srvc_name")
+        protected String tagServiceName;
+
+        @Override
+        public void setId(Long id) {
+                this.id=id;
+        }
+
+        @Override
+        public Long getId() {
+                return id;
+        }
+
+        public Long getZoneId() {
+                return zoneId;
+        }
+
+        public Long getTagServiceId() {
+                return tagServiceId;
+        }
+
+        public String getTagServiceName() {
+                return tagServiceName;
+        }
+
+        public void setZoneId(Long zoneId) {
+                this.zoneId = zoneId;
+        }
+
+        public void setTagServiceId(Long tagServiceId) {
+                this.tagServiceId = tagServiceId;
+        }
+
+        public void setTagServiceName(String tagServiceName) {
+                this.tagServiceName = tagServiceName;
+        }
+
+        @Override
+        public int hashCode() {
+                return Objects.hash(super.hashCode(), id, zoneId, 
tagServiceId, tagServiceName);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+                if (this == obj) {
+                        return true;
+                }
+
+                if (getClass() != obj.getClass()) {
+                        return false;
+                }
+
+                XXSecurityZoneRefTagService other = 
(XXSecurityZoneRefTagService) obj;
+
+                return super.equals(obj) &&
+                           Objects.equals(id, other.id) &&
+                           Objects.equals(zoneId, other.zoneId) &&
+                           Objects.equals(tagServiceId, other.tagServiceId) &&
+                           Objects.equals(tagServiceName, 
other.tagServiceName);
+        }
+
+        @Override
+        public String toString() {
+                return "XXSecurityZoneRefTagService [id=" + id + ", zoneId=" + 
zoneId + ", tagServiceId=" + tagServiceId
+                                + ", tagServiceName=" + tagServiceName + "]";
+        }
+}
diff --git 
a/security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java 
b/security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java
index ec69d6e..3c1b1d2 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java
@@ -274,6 +274,7 @@ public class SecurityZoneREST {
        }
 
        private void removeEmptyEntries(RangerSecurityZone securityZone) {
+                bizUtil.removeEmptyStrings(securityZone.getTagServices());
                bizUtil.removeEmptyStrings(securityZone.getAdminUsers());
                bizUtil.removeEmptyStrings(securityZone.getAdminUserGroups());
                bizUtil.removeEmptyStrings(securityZone.getAuditUsers());
diff --git 
a/security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
 
b/security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
index 7927e31..f2a505c 100644
--- 
a/security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
+++ 
b/security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
@@ -74,6 +74,7 @@ public class RangerSecurityZoneServiceService extends 
RangerSecurityZoneServiceB
                trxLogAttrs.put("auditUsers", new VTrxLogAttr("auditUsers", 
"Zone Audit Users", false));
                trxLogAttrs.put("auditUserGroups", new 
VTrxLogAttr("auditUserGroups", "Zone Audit User Groups", false));
                trxLogAttrs.put("description", new VTrxLogAttr("description", 
"Zone Description", false));
+                trxLogAttrs.put("tagServices", new VTrxLogAttr("tagServices", 
"Zone Tag Services", false));
        }
 
     public RangerSecurityZoneServiceService() {
@@ -116,6 +117,7 @@ public class RangerSecurityZoneServiceService extends 
RangerSecurityZoneServiceB
                 ret.setAdminUserGroups(zoneFromJsonData.getAdminUserGroups());
                 ret.setAuditUsers(zoneFromJsonData.getAuditUsers());
                 ret.setAuditUserGroups(zoneFromJsonData.getAuditUserGroups());
+                ret.setTagServices(zoneFromJsonData.getTagServices());
             }
         } else {
             logger.info("Empty string representing jsonData in [" + 
xxSecurityZone + "]!!");
@@ -143,7 +145,7 @@ public class RangerSecurityZoneServiceService extends 
RangerSecurityZoneServiceB
         return ret;
     }
 
-    @Override
+        @Override
     public RangerSecurityZone postUpdate(XXSecurityZone xObj) {
         // Update ServiceVersionInfo for all affected services
         RangerSecurityZone ret = super.postUpdate(xObj);
diff --git a/security-admin/src/main/resources/META-INF/jpa_named_queries.xml 
b/security-admin/src/main/resources/META-INF/jpa_named_queries.xml
index 7e702c1..18dc5fe 100644
--- a/security-admin/src/main/resources/META-INF/jpa_named_queries.xml
+++ b/security-admin/src/main/resources/META-INF/jpa_named_queries.xml
@@ -1357,6 +1357,12 @@
         </query>
     </named-query>
 
+    <named-query name="XXSecurityZoneRefTagService.findByZoneId">
+        <query>
+            select obj from XXSecurityZoneRefTagService obj where obj.zoneId = 
:zoneId
+        </query>
+    </named-query>
+
        <named-query name="XXSecurityZoneRefUser.findByZoneId">
         <query>
             select obj from XXSecurityZoneRefUser obj where obj.zoneId = 
:zoneId
diff --git a/security-admin/src/main/webapp/scripts/models/RangerZone.js 
b/security-admin/src/main/webapp/scripts/models/RangerZone.js
index 4f99c83..f91c96f 100644
--- a/security-admin/src/main/webapp/scripts/models/RangerZone.js
+++ b/security-admin/src/main/webapp/scripts/models/RangerZone.js
@@ -59,6 +59,15 @@ define(function(require) {
                         title: 'Description',
                         validators: []
                     },
+                    tagServices : {
+                        type : 'Select2Remote',
+                        title : 'Select Tag Services',
+                        pluginAttr : XAUtil.getTagBaseServices(),
+                        options    : function(callback, editor){
+                            callback();
+                        },
+                        onFocusOpen : false
+                    },
                     adminUsers: {
                         type: 'Select2Remote',
                         title: 'Admin Users',
diff --git a/security-admin/src/main/webapp/scripts/utils/XAUtils.js 
b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
index 29c33f5..6da76d5 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAUtils.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAUtils.js
@@ -1496,5 +1496,59 @@ define(function(require) {
         return condtionsDetails;
     }
 
+    //get list of all tag base services
+    XAUtils.getTagBaseServices = function(){
+        return {
+            closeOnSelect : true,
+            placeholder : 'Select Tag Services',
+            width :'600px',
+            allowClear: true,
+            multiple: true,
+            tokenSeparators: ["," , " "],
+            initSelection : function (element, callback) {
+                var tags = [];
+                _.each(element.val().split(','), function(name) {
+                    tags.push({
+                        'id': _.escape(name),
+                        'text': _.escape(name)
+                    });
+                });
+                callback(tags)
+            },
+            ajax: {
+                url: "service/plugins/services",
+                dataType: 'json',
+                data: function (term, page) {
+                    return { serviceNamePartial : term, serviceType : 'tag' };
+                },
+                results: function (data, page) {
+                    var results = [];
+                    if(data.resultSize != "0"){
+                        results = data.services.map(function(m, i){ return {id 
: _.escape(m.name), text: _.escape(m.name) };    });
+                        return {results : results};
+                    }
+                    return {results : results};
+                },
+                transport : function (options) {
+                                            
$.ajax(options).fail(function(respones) {
+                        XAUtils.defaultErrorHandler('error',respones);
+                        this.success({
+                            resultSize : 0
+                        });
+                    });
+                }
+            },
+            formatResult : function(result){
+                return result.text;
+            },
+            formatSelection : function(result){
+                return result.text;
+            },
+            formatNoMatches: function(result){
+                return 'No tag service found.';
+            }
+        };
+    }
+
        return XAUtils;
 });
\ No newline at end of file
diff --git 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
index d3eb026..fd3bb4e 100644
--- 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
+++ 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
@@ -338,45 +338,29 @@ define(function(require){
                 });
             }
             if (selectedZone && !_.isEmpty(selectedZone)) {
-                var selectedZoneServices = [];
+                var selectedZoneServices = [], model;
                 if(this.type !== XAEnums.ServiceType.SERVICE_TAG.label){
                     _.each(selectedZone.get('services'), function(value, key) {
-                        var model = that.services.find(function(m) {
+                        model = that.services.find(function(m) {
                             return m.get('name') == key
-                        })
+                        });
                         if (model) {
                             selectedZoneServices.push(model);
                         }
                     });
-                    return _.groupBy(selectedZoneServices, function(m) {
-                        return m.get('type')
-                    });
                 }else{
-                    var tagAssociatedServices = _.filter(this.services.models, 
function(m, key){
-                        return m.get('tagService') && 
!_.isEmpty(m.get('tagService'))
-                    }),
-                    zoneServiceList = _.keys (selectedZone.get('services')),
-                    tagServiceGrp = _.groupBy(tagAssociatedServices, 
function(m){return m.get('tagService')});
-                    //Compare tag associate service with zone services and 
return tag name that services match to zone services.
-                    _.each(tagServiceGrp, function(m, key){
-                        var hasTag = _.some(m, function(model){
-                            return zoneServiceList.indexOf(model.get("name")) 
!== -1;
-                        })
-                        if (hasTag) {
-                            var models = 
that.services.models.filter(function(obj){
-                                return obj.get("name") === key
-                            })
-                            if (models.length > 0) {
-                                selectedZoneServices = 
_.union(selectedZoneServices,models);
-                            }
+                    _.each(selectedZone.get('tagServices'), function(value){
+                        model = that.services.find(function(m) {
+                            return m.get('name') == value
+                        });
+                        if (model) {
+                            selectedZoneServices.push(model);
                         }
-                    });
-                    //Tag services listed by create time of that services
-                    selectedZoneServices = 
_.sortBy(selectedZoneServices,function(service){return 
service.get('createTime')});
-                    return _.groupBy(selectedZoneServices, function(obj){
-                        return obj.get("type");
                     })
                 }
+                return _.groupBy(selectedZoneServices, function(m) {
+                        return m.get('type')
+                });
             } else {
                 return that.services.groupBy("type")
             }
diff --git 
a/security-admin/src/main/webapp/scripts/views/security_zone/SecurityZone.js 
b/security-admin/src/main/webapp/scripts/views/security_zone/SecurityZone.js
index 2a07020..9bce74b 100644
--- a/security-admin/src/main/webapp/scripts/views/security_zone/SecurityZone.js
+++ b/security-admin/src/main/webapp/scripts/views/security_zone/SecurityZone.js
@@ -78,7 +78,6 @@ define(function(require) {
             'zoneName': '[data-id="zoneName"]',
             'deleteZone': '[data-id="deleteZone"]',
             'editZone': '[data-id="editZone"]',
-            'zoneAdministrationDetail': '[data-id="zoneAdministrationDetail"]',
             'zoneSearch' : '[data-id="zoneSearch"]',
             'zoneUlList' : '[data-id="zoneUlList"]'
         },
@@ -91,7 +90,6 @@ define(function(require) {
             events['click ' + this.ui.sideBar] = 'onSidebar';
             events['click ' + this.ui.zoneTable] = 'renderTable';
             events['click ' + this.ui.deleteZone] = 'onDelete';
-            events['click ' + this.ui.zoneAdministrationDetail] = 
'zoneAdministrationDetail';
             events['keyup ' + this.ui.zoneSearch] = 'zoneSearch';
 
             return events;
diff --git 
a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneAdministration.js
 
b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneAdministration.js
index 63fafb4..1dfa36c 100644
--- 
a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneAdministration.js
+++ 
b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneAdministration.js
@@ -35,8 +35,12 @@ define(function(require) {
             template: ZoneAdministrationTmpl,
 
             templateHelpers: function() {
+                var tagServices = this.zoneModel && 
this.zoneModel.get('tagServices') ? this.zoneModel.get('tagServices') : '';
                 return {
-                    zoneModel: this.zoneModel
+                    zoneModel: this.zoneModel,
+                    tagServices : tagServices,
+                    description : (this.zoneModel && 
this.zoneModel.get('description') && 
!_.isEmpty(this.zoneModel.get('description')))
+                        ? this.zoneModel.get('description') : false,
                 }
             },
 
diff --git 
a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneCreate.js 
b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneCreate.js
index dd34605..e0fab23 100644
--- a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneCreate.js
@@ -165,6 +165,7 @@ define(function(require) {
                 this.model.set('adminUserGroups', 
this.model.get('adminUserGroups').split(','));
                 this.model.set('auditUsers', 
this.model.get('auditUsers').split(','));
                 this.model.set('auditUserGroups', 
this.model.get('auditUserGroups').split(','));
+                this.model.set('tagServices', 
this.model.get('tagServices').split(','));
                 this.model.unset('policyType');
                 XAUtil.blockUI();
                 this.model.save({}, {
diff --git a/security-admin/src/main/webapp/styles/xa.css 
b/security-admin/src/main/webapp/styles/xa.css
index 60e045c..6ae646d 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -2572,28 +2572,28 @@ textarea:read-only{
   color: #64a224;
   margin-top: 0;
 }
-#zone-admin-accordion .accordion-group {
+.zone-accordion .accordion-group {
   border-color: #ccc;
 }
-#zone-admin-accordion .accordion-heading .accordion-toggle {
+.zone-accordion .accordion-heading .accordion-toggle {
   background-color: #eeeeee;
   color: #444;
   text-decoration: none;
   font-weight: bold;
   border-bottom: 1px solid #ccc;
 }
-#zone-admin-accordion .accordion-inner {
+.zone-accordion .accordion-inner {
   border-top: none;
 }
-#zone-admin-accordion .accordion-heading .accordion-toggle:after {
+.zone-accordion .accordion-heading .accordion-toggle:after {
   font-family: 'FontAwesome';
   content: "\f078";
   float: right;
 }
-#zone-admin-accordion .form-horizontal .control-group {
+.zone-accordion .form-horizontal .control-group {
   margin-bottom: 10px;
 }
-#zone-admin-accordion form {
+.zone-accordion form {
   margin-bottom: 0px;
 }
 .table-operations-new > thead > tr > th {
@@ -2699,4 +2699,18 @@ textarea:read-only{
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 300px;
+}
+#zoneServiceAccordion .accordion-inner{
+  padding:0px;
+  border: 0px;
+}
+#zoneServiceAccordion{
+  border-top: 1px solid #e5e5e5;
+}
+#zoneServiceAccordion .accordion-inner .table-responsive,
+#zoneServiceAccordion .accordion-inner .pagination{
+  margin: 0px;
+}
+div#zoneServiceAccordion table thead {
+  background: none;
 }
\ No newline at end of file
diff --git 
a/security-admin/src/main/webapp/templates/security_zone/SecurityZone_tmpl.html 
b/security-admin/src/main/webapp/templates/security_zone/SecurityZone_tmpl.html
index a2f1374..b14519c 100644
--- 
a/security-admin/src/main/webapp/templates/security_zone/SecurityZone_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/security_zone/SecurityZone_tmpl.html
@@ -56,11 +56,8 @@
     {{#if zoneList.length}}
         <div class="security-details">
             <div class="row-fluid">
-                <div class="span1">
-                <button class="btn btn-default btn-small btn-slide-toggle" 
data-id="sideBarBtn"><i class="icon-reorder"></i><span></span></button>
-                </div>
-                <div class="span7">
-                    <h2 data-id="zoneName" class="trim-containt" 
title="{{{zoneModelName}}}">{{{zoneModelName}}}</h2>
+                <div class="span8">
+                    <button class="btn btn-default btn-small btn-slide-toggle 
pull-left m-r-sm" data-id="sideBarBtn"><i 
class="icon-reorder"></i><span></span></button><h2 
data-id="zoneName">{{{zoneModelName}}}</h2>
                 </div>
                 {{#if isZoneAdministration}}
                     <div class="span4">
@@ -72,24 +69,19 @@
                     </div>
                 {{/if}}
             </div>
-            <div class="row-fluid">
-                <div class="span12">
-                    <div class="accordion" id="zone-admin-accordion">
-                        <div class="accordion-group">
-                          <div class="accordion-heading accordion-opened">
-                            <a class="accordion-toggle" data-toggle="collapse" 
data-parent="#zone-admin-accordion" href="#collapseOne">Zone Administration</a>
-                          </div>
-
-                          <div id="collapseOne" class="accordion-body in 
collapse" style="height: auto;">
-                            <div class="accordion-inner" 
data-id="zoneAdministrationView"></div>
-                          </div>
+            <div class="row-fluid" data-id="zoneAdministrationView"></div>
+            <div class="accordion zone-accordion" id="zoneServiceAccordion">
+                <div class="accordion-group">
+                    <div class="accordion-heading accordion-opened">
+                        <a class="accordion-toggle" data-toggle="collapse" 
data-parent="#zoneServiceAccordion" href="#collapseZoneService">Services</a>
+                    </div>
+                    <div id="collapseZoneService" class="accordion-body in 
collapse" style="height: auto;">
+                        <div class="accordion-inner">
+                            <div class="span12" 
data-id="zoneTableLayout"></div>
                         </div>
                     </div>
                 </div>
             </div>
-            <div class="row-fluid">
-              <div class="span12" data-id="zoneTableLayout"></div>
-            </div>
         </div>
     {{else}}
         {{#if isZoneAdministration}}
diff --git 
a/security-admin/src/main/webapp/templates/security_zone/ZoneAdministration_tmpl.html
 
b/security-admin/src/main/webapp/templates/security_zone/ZoneAdministration_tmpl.html
index 89acb10..125bf86 100644
--- 
a/security-admin/src/main/webapp/templates/security_zone/ZoneAdministration_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/security_zone/ZoneAdministration_tmpl.html
@@ -10,57 +10,93 @@ law or agreed to in writing, software distributed under the 
License is
 distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied. See the License for the specific
 language governing permissions and limitations under the License. --}}
+{{#if description}}
+    <div class="row-fluid">
+        <div class="span12">
+            <p>{{this.zoneModel.attributes.description}}</p>
+        </div>
+    </div>
+{{/if}}
 <div class="row-fluid">
     <div class="span12">
-        <form class="form-horizontal form-administration">
-            <div class="control-group">
-                <label class="control-label" for="inputEmail">Admin 
Users</label>
-                <div class="controls">
-                    {{#compare this.zoneModel.attributes.adminUsers "eq" ''}}
-                        <span> -- </span>
-                    {{else}}
-                        {{#each this.zoneModel.attributes.adminUsers}}
-                            <span class="label label-info">{{this}}</span>
-                        {{/each}}
-                    {{/compare}}
-                </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label" for="inputEmail">Admin 
Usergroups</label>
-                <div class="controls">
-                    {{#compare this.zoneModel.attributes.adminUserGroups "eq" 
''}}
-                        <span> -- </span>
-                    {{else}}
-                        {{#each this.zoneModel.attributes.adminUserGroups}}
-                            <span class="label label-default">{{this}}</span>
-                        {{/each}}
-                    {{/compare}}
+        <div class="accordion zone-accordion" id="zone-admin-accordion">
+            <div class="accordion-group">
+                <div class="accordion-heading accordion-opened">
+                    <a class="accordion-toggle" data-toggle="collapse" 
data-parent="#zone-admin-accordion" href="#collapseOne">Zone Administration</a>
                 </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label" for="inputEmail">Auditor 
Users</label>
-                <div class="controls">
-                    {{#compare this.zoneModel.attributes.auditUsers "eq" ''}}
-                        <span> -- </span>
-                    {{else}}
-                        {{#each this.zoneModel.attributes.auditUsers}}
-                            <span class="label label-info">{{this}}</span>
-                        {{/each}}
-                    {{/compare}}
+                <div id="collapseOne" class="accordion-body in collapse" 
style="height: auto;">
+                    <div class="accordion-inner">
+                        <form class="form-horizontal form-administration">
+                            <div class="control-group">
+                                <label class="control-label" 
for="inputEmail">Admin Users</label>
+                                <div class="controls">
+                                    {{#compare 
this.zoneModel.attributes.adminUsers "eq" ''}}
+                                        <span> -- </span>
+                                    {{else}}
+                                        {{#each 
this.zoneModel.attributes.adminUsers}}
+                                            <span class="label 
label-info">{{this}}</span>
+                                        {{/each}}
+                                    {{/compare}}
+                                </div>
+                            </div>
+                            <div class="control-group">
+                                <label class="control-label" 
for="inputEmail">Admin Usergroups</label>
+                                <div class="controls">
+                                    {{#compare 
this.zoneModel.attributes.adminUserGroups "eq" ''}}
+                                        <span> -- </span>
+                                    {{else}}
+                                        {{#each 
this.zoneModel.attributes.adminUserGroups}}
+                                            <span class="label 
label-default">{{this}}</span>
+                                        {{/each}}
+                                    {{/compare}}
+                                </div>
+                            </div>
+                            <div class="control-group">
+                                <label class="control-label" 
for="inputEmail">Auditor Users</label>
+                                <div class="controls">
+                                    {{#compare 
this.zoneModel.attributes.auditUsers "eq" ''}}
+                                        <span> -- </span>
+                                    {{else}}
+                                        {{#each 
this.zoneModel.attributes.auditUsers}}
+                                            <span class="label 
label-info">{{this}}</span>
+                                        {{/each}}
+                                    {{/compare}}
+                                </div>
+                            </div>
+                            <div class="control-group">
+                                <label class="control-label" 
for="inputEmail">Auditor Usergroups</label>
+                                <div class="controls">
+                                    {{#compare 
this.zoneModel.attributes.auditUserGroups "eq" ''}}
+                                        <span> -- </span>
+                                    {{else}}
+                                        {{#each 
this.zoneModel.attributes.auditUserGroups}}
+                                            <span class="label 
label-default">{{this}}</span>
+                                        {{/each}}
+                                    {{/compare}}
+                                </div>
+                            </div>
+                        </form>
+                    </div>
                 </div>
             </div>
-            <div class="control-group">
-                <label class="control-label" for="inputEmail">Auditor 
Usergroups</label>
-                <div class="controls">
-                    {{#compare this.zoneModel.attributes.auditUserGroups "eq" 
''}}
-                        <span> -- </span>
-                    {{else}}
-                        {{#each this.zoneModel.attributes.auditUserGroups}}
-                            <span class="label label-default">{{this}}</span>
-                        {{/each}}
-                    {{/compare}}
-                </div>
+        </div>
+    </div>
+</div>
+<div class="accordion zone-accordion" id="zone-tag-accordion">
+    <div class="accordion-group">
+        <div class="accordion-heading accordion-opened">
+            <a class="accordion-toggle" data-toggle="collapse" 
data-parent="#zone-tag-accordion" href="#collapseTag">Zone Tag Services</a>
+        </div>
+        <div id="collapseTag" class="accordion-body in collapse" 
style="height: auto;">
+            <div class="accordion-inner">
+                {{#if tagServices}}
+                    {{#each tagServices}}
+                        <span class="label label-info">{{this}}</span>
+                    {{/each}}
+                {{else}}
+                    <span> No tag based services are associated with this zone 
</span>
+                {{/if}}
             </div>
-        </form>
+        </div>
     </div>
-</div
\ No newline at end of file
+</div>
diff --git 
a/security-admin/src/main/webapp/templates/security_zone/ZoneCreateForm_tmpl.html
 
b/security-admin/src/main/webapp/templates/security_zone/ZoneCreateForm_tmpl.html
index fdcb821..779119a 100644
--- 
a/security-admin/src/main/webapp/templates/security_zone/ZoneCreateForm_tmpl.html
+++ 
b/security-admin/src/main/webapp/templates/security_zone/ZoneCreateForm_tmpl.html
@@ -67,8 +67,14 @@
         </div>
         <div class="form-horizontal">
             <p class="formHeader"> Services : </p>
+            <div class="control-group">
+                <label class="control-label">Select Tag Services </label>
+                <div class="controls">
+                    <div data-editors="tagServices"></div>
+                </div>
+            </div>
             <div class="control-group" data-id="selectServicesName">
-                <label class="control-label"> Select Service Name * </label>
+                <label class="control-label"> Select Resource Services * 
</label>
                 <div class="controls">
                     <input type="text" style="width: 600px;" 
data-id="servicesName"/>
                     <div class="help-inline" data-id="serviceNameHelp" 
style="display:none">  Required </div>

Reply via email to