The HBAC service, HBAC service group, sudo command and sudo command
group have been modified to show the associations as facets.

Ticket #1536

--
Endi S. Dewata
From 2445adacfa78ce0bf400c5f91190654b52fc2027 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Thu, 28 Jul 2011 17:23:41 -0500
Subject: [PATCH] Added association facets for HBAC and sudo.

The HBAC service, HBAC service group, sudo command and sudo command
group have been modified to show the associations as facets.

Ticket #1536
---
 install/ui/hbac.js |   58 +++++++++++++++++++++-----
 install/ui/sudo.js |  116 +++++++++++++++++++++-------------------------------
 2 files changed, 94 insertions(+), 80 deletions(-)

diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 2cdb710ab24c8fb6a65c9298ca80a27bbc6d45f4..4e25123e4cd6c755d57a495347fb9a926e6f35bf 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -63,6 +63,30 @@ IPA.entity_factories.hbacsvc = function() {
             name: 'general',
             label: IPA.messages.details.general,
             fields:[ 'cn', 'description']}]}).
+        association_facet({
+            name: 'memberof_hbacsvcgroup',
+            associator: IPA.serial_associator,
+            columns:[
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    link: true
+                },
+                { name: 'description' }
+            ],
+            adder_columns: [
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    width: '100px'
+                },
+                {
+                    name: 'description',
+                    width: '100px'
+                }
+            ]
+        }).
+        standard_association_facets().
         adder_dialog({
             fields:['cn','description']
         }).
@@ -80,18 +104,30 @@ IPA.entity_factories.hbacsvcgroup = function() {
                 name: 'general',
                 label: IPA.messages.details.general,
                 fields:['cn','description']
-            },
-            {
-                name: 'services',
-                label: IPA.messages.objects.hbacsvcgroup.services,
-                fields:[{
-                    factory: IPA.hbacsvcgroup_member_hbacsvc_table_widget,
-                    name: 'member_hbacsvc',
-                    label: IPA.messages.objects.hbacsvcgroup.services,
-                    other_entity: 'hbacsvc',
-                    save_values: false
-                }]
             }]}).
+        association_facet({
+            name: 'member_hbacsvc',
+            columns:[
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    link: true
+                },
+                { name: 'description' }
+            ],
+            adder_columns: [
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    width: '100px'
+                },
+                {
+                    name: 'description',
+                    width: '100px'
+                }
+            ]
+        }).
+        standard_association_facets().
         adder_dialog({
             fields:['cn', 'description']
         }).
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index d725f214cb42acf3ff34df8310b13287810a0fe7..d8d633142437b5e094e58d34a7360b271254aef2 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -50,42 +50,31 @@ IPA.entity_factories.sudocmd = function() {
                 name: 'general',
                 label: IPA.messages.details.general,
                 fields:['sudocmd','description']
-            },
-            {
-                name: 'groups',
-                label: IPA.messages.objects.sudocmd.groups,
-                factory: IPA.details_section,
-                fields:[{
-                    factory: IPA.sudocmd_member_sudocmdgroup_table_widget,
-                    name: 'memberof_sudocmdgroup',
-                    label: '',//IPA.messages.objects.sudocmd.groups,
-                    other_entity: 'sudocmdgroup',
-                    save_values: false,
-                    columns:[
-                        {
-                            name: 'cn',
-                            primary_key: true,
-                            width: '150px',
-                            link: true
-                        },
-                        {
-                            name: 'description',
-                            width: '150px'
-                        }
-                    ],
-                    adder_columns:[
-                        {
-                            name: 'cn',
-                            primary_key: true,
-                            width: '100px'
-                        },
-                        {
-                            name: 'description',
-                            width: '100px'
-                        }
-                    ]
-                }]
             }]}).
+        association_facet({
+            name: 'memberof_sudocmdgroup',
+            associator: IPA.serial_associator,
+            columns:[
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    link: true
+                },
+                { name: 'description' }
+            ],
+            adder_columns:[
+                {
+                    name: 'cn',
+                    primary_key: true,
+                    width: '100px'
+                },
+                {
+                    name: 'description',
+                    width: '100px'
+                }
+            ]
+        }).
+        standard_association_facets().
         adder_dialog({
             fields:['sudocmd','description']
         }).
@@ -105,41 +94,30 @@ IPA.entity_factories.sudocmdgroup = function() {
                 name: 'general',
                 label: IPA.messages.details.general,
                 fields:['cn','description']
-            },
-            {
-                name: 'commands',
-                factory:  IPA.details_section,
-                fields: [{
-                    factory: IPA.association_table_widget,
-                    name: 'member_sudocmd',
-                    label: IPA.messages.objects.sudocmdgroup.commands,
-                    other_entity: 'sudocmd',
-                    save_values: false,
-                    columns:[
-                        {
-                            name: 'sudocmd',
-                            primary_key: true,
-                            width: '150px',
-                            link: true
-                        },
-                        {
-                            name: 'description',
-                            width: '150px'
-                        }
-                    ],
-                    adder_columns: [
-                        {
-                            name: 'sudocmd',
-                            primary_key: true,
-                            width: '100px'
-                        },
-                        {
-                            name: 'description',
-                            width: '100px'
-                        }
-                    ]
-                }]
             }]}).
+        association_facet({
+            name: 'member_sudocmd',
+            columns:[
+                {
+                    name: 'sudocmd',
+                    primary_key: true,
+                    link: true
+                },
+                { name: 'description' }
+            ],
+            adder_columns: [
+                {
+                    name: 'sudocmd',
+                    primary_key: true,
+                    width: '100px'
+                },
+                {
+                    name: 'description',
+                    width: '100px'
+                }
+            ]
+        }).
+        standard_association_facets().
         adder_dialog({
             fields:['cn','description']
         }).
-- 
1.7.5.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to