summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-01-18 17:58:55 -0600
committerPetr Voborník <pvoborni@redhat.com>2012-01-23 15:40:07 +0100
commitdb4deb26f52a3104d31137e9689db4859b532cf9 (patch)
treec5730dfa5cbe436064ce549f4009f73fcd367c38
parentc92309f705b09797bf0071e6c5554b6027716b11 (diff)
downloadfreeipa.git-db4deb26f52a3104d31137e9689db4859b532cf9.tar.gz
freeipa.git-db4deb26f52a3104d31137e9689db4859b532cf9.tar.xz
freeipa.git-db4deb26f52a3104d31137e9689db4859b532cf9.zip
Show disabled entries in gray.
The users, HBAC/sudo rules, HBAC test, and SELinux list pages have been modified to show disabled entries in gray. Icons will be added separately. Ticket #1996
-rw-r--r--install/ui/facet.js25
-rw-r--r--install/ui/hbac.js5
-rw-r--r--install/ui/hbactest.js14
-rw-r--r--install/ui/ipa.css4
-rw-r--r--install/ui/selinux.js5
-rw-r--r--install/ui/sudo.js5
-rw-r--r--install/ui/test/data/hbacrule_get_records.json15
-rw-r--r--install/ui/test/data/selinuxusermap_find_pkeys.json8
-rw-r--r--install/ui/test/data/selinuxusermap_get_records.json30
-rw-r--r--install/ui/test/data/sudorule_find_pkeys.json8
-rw-r--r--install/ui/test/data/sudorule_get_records.json98
-rw-r--r--install/ui/test/data/user_get_records.json6
-rw-r--r--install/ui/user.js4
-rw-r--r--install/ui/widget.js28
14 files changed, 239 insertions, 16 deletions
diff --git a/install/ui/facet.js b/install/ui/facet.js
index d6502494..150c3e8f 100644
--- a/install/ui/facet.js
+++ b/install/ui/facet.js
@@ -413,6 +413,9 @@ IPA.table_facet = function(spec) {
that.search_all_attributes = spec.search_all_attributes;
that.selectable = spec.selectable === undefined ? true : spec.selectable;
+ that.row_enabled_attribute = spec.row_enabled_attribute;
+ that.row_disabled_attribute = spec.row_disabled_attribute;
+
that.columns = $.ordered_map();
var init = function() {
@@ -605,11 +608,31 @@ IPA.table_facet = function(spec) {
that.load_records = function(records) {
that.table.empty();
for (var i=0; i<records.length; i++) {
- that.table.add_record(records[i]);
+ that.add_record(records[i]);
}
that.table.set_values(that.selected_values);
};
+ that.add_record = function(record) {
+
+ var tr = that.table.add_record(record);
+
+ var attribute;
+ if (that.row_enabled_attribute) {
+ attribute = that.row_enabled_attribute;
+ } else if (that.row_disabled_attribute) {
+ attribute = that.row_disabled_attribute;
+ } else {
+ return;
+ }
+
+ var value = record[attribute];
+ var column = that.table.get_column(attribute);
+ if (column.format) value = column.format.parse(value);
+
+ that.table.set_row_enabled(tr, value);
+ };
+
that.get_records_command_name = function() {
return that.managed_entity.name+'_get_records';
};
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 34c9b285..5d6de15d 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -37,12 +37,15 @@ IPA.hbac.rule_entity = function(spec) {
that.entity_init();
that.builder.search_facet({
+ row_enabled_attribute: 'ipaenabledflag',
search_all_attributes: true,
columns: [
'cn',
{
name: 'ipaenabledflag',
- format: IPA.boolean_format()
+ format: IPA.boolean_format({
+ show_false: true
+ })
},
'description'
]
diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js
index f054c913..b529a1d5 100644
--- a/install/ui/hbactest.js
+++ b/install/ui/hbactest.js
@@ -43,6 +43,7 @@ IPA.hbac.test_entity = function(spec) {
managed_entity: 'user',
disable_breadcrumb: true,
facet_group: 'default',
+ row_disabled_attribute: 'nsaccountlock',
columns: [
'uid',
'givenname',
@@ -52,7 +53,8 @@ IPA.hbac.test_entity = function(spec) {
format: IPA.boolean_format({
true_value: IPA.messages.objects.user.active,
false_value: IPA.messages.objects.user.inactive,
- invert_value: true
+ invert_value: true,
+ show_false: true
}),
label: IPA.messages.objects.user.account_status
}
@@ -111,11 +113,14 @@ IPA.hbac.test_entity = function(spec) {
managed_entity: 'hbacrule',
disable_breadcrumb: true,
facet_group: 'default',
+ row_enabled_attribute: 'ipaenabledflag',
columns: [
'cn',
{
name: 'ipaenabledflag',
- format: IPA.boolean_format()
+ format: IPA.boolean_format({
+ show_false: true
+ })
},
'description'
]
@@ -127,6 +132,7 @@ IPA.hbac.test_entity = function(spec) {
managed_entity: 'hbacrule',
disable_breadcrumb: true,
facet_group: 'default',
+ row_enabled_attribute: 'ipaenabledflag',
columns: [
'cn',
{
@@ -136,7 +142,9 @@ IPA.hbac.test_entity = function(spec) {
},
{
name: 'ipaenabledflag',
- format: IPA.boolean_format()
+ format: IPA.boolean_format({
+ show_false: true
+ })
},
'description'
]
diff --git a/install/ui/ipa.css b/install/ui/ipa.css
index ab27bcfc..10fed5de 100644
--- a/install/ui/ipa.css
+++ b/install/ui/ipa.css
@@ -659,6 +659,10 @@ div[name=settings].facet-group li a {
bottom: 35px;
}
+.content-table tbody tr.disabled {
+ color: gray;
+}
+
.search-filter {
width: 215px;
-moz-border-radius: 15px !important;
diff --git a/install/ui/selinux.js b/install/ui/selinux.js
index bfe25df0..1ca11760 100644
--- a/install/ui/selinux.js
+++ b/install/ui/selinux.js
@@ -35,13 +35,16 @@ IPA.selinux.selinuxusermap_entity = function(spec) {
that.entity_init();
that.builder.search_facet({
+ row_enabled_attribute: 'ipaenabledflag',
search_all_attributes: true,
columns: [
'cn',
'ipaselinuxuser',
{
name: 'ipaenabledflag',
- format: IPA.boolean_format()
+ format: IPA.boolean_format({
+ show_false: true
+ })
},
'description'
]
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 2266bb8c..f1b64bd5 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -36,11 +36,14 @@ IPA.sudo.rule_entity = function(spec) {
that.entity_init();
that.builder.search_facet({
+ row_enabled_attribute: 'ipaenabledflag',
columns: [
'cn',
{
name: 'ipaenabledflag',
- format: IPA.boolean_format()
+ format: IPA.boolean_format({
+ show_false: true
+ })
},
'description'
]
diff --git a/install/ui/test/data/hbacrule_get_records.json b/install/ui/test/data/hbacrule_get_records.json
index 2ae32f52..bff83920 100644
--- a/install/ui/test/data/hbacrule_get_records.json
+++ b/install/ui/test/data/hbacrule_get_records.json
@@ -52,6 +52,9 @@
"cn": [
"rule01"
],
+ "description": [
+ "Test HBAC Rule 01"
+ ],
"dn": "ipauniqueid=ce568648-211c-11e1-8846-000c29e9f1b6,cn=hbac,dc=example,dc=com",
"hostcategory": [
"all"
@@ -88,6 +91,9 @@
"cn": [
"rule02"
],
+ "description": [
+ "Test HBAC Rule 02"
+ ],
"dn": "ipauniqueid=d0133224-211c-11e1-b881-000c29e9f1b6,cn=hbac,dc=example,dc=com",
"hostcategory": [
"all"
@@ -124,6 +130,9 @@
"cn": [
"rule03"
],
+ "description": [
+ "Test HBAC Rule 03"
+ ],
"dn": "ipauniqueid=d21db45e-211c-11e1-bef8-000c29e9f1b6,cn=hbac,dc=example,dc=com",
"hostcategory": [
"all"
@@ -160,6 +169,9 @@
"cn": [
"rule04"
],
+ "description": [
+ "Test HBAC Rule 04"
+ ],
"dn": "ipauniqueid=d4209604-211c-11e1-9192-000c29e9f1b6,cn=hbac,dc=example,dc=com",
"hostcategory": [
"all"
@@ -196,6 +208,9 @@
"cn": [
"rule05"
],
+ "description": [
+ "Test HBAC Rule 05"
+ ],
"dn": "ipauniqueid=d59dba70-211c-11e1-9ce3-000c29e9f1b6,cn=hbac,dc=example,dc=com",
"hostcategory": [
"all"
diff --git a/install/ui/test/data/selinuxusermap_find_pkeys.json b/install/ui/test/data/selinuxusermap_find_pkeys.json
index 016e5126..a4163feb 100644
--- a/install/ui/test/data/selinuxusermap_find_pkeys.json
+++ b/install/ui/test/data/selinuxusermap_find_pkeys.json
@@ -9,9 +9,15 @@
"karel_unconfined"
],
"dn": "ipauniqueid=dbe2ffa0-3c2c-11e1-ad81-00163e6185c4,cn=usermap,cn=selinux,dc=dev,dc=example,dc=com"
+ },
+ {
+ "cn": [
+ "test01"
+ ],
+ "dn": "ipauniqueid=dbe2ffa0-3c2c-11e1-ad81-00163e6185c4,cn=usermap,cn=selinux,dc=dev,dc=example,dc=com"
}
],
- "summary": "1 SELinux User Map matched",
+ "summary": "2 SELinux User Maps matched",
"truncated": false
}
} \ No newline at end of file
diff --git a/install/ui/test/data/selinuxusermap_get_records.json b/install/ui/test/data/selinuxusermap_get_records.json
index 61d80fb5..518b1365 100644
--- a/install/ui/test/data/selinuxusermap_get_records.json
+++ b/install/ui/test/data/selinuxusermap_get_records.json
@@ -33,6 +33,36 @@
},
"summary": null,
"value": "karel_unconfined"
+ },
+ {
+ "error": null,
+ "result": {
+ "cn": [
+ "test01"
+ ],
+ "description": [
+ "Test SELinux User Map 01"
+ ],
+ "dn": "ipauniqueid=dbe2ffa0-3c2c-11e1-ad81-00163e6185c4,cn=usermap,cn=selinux,dc=dev,dc=example,dc=com",
+ "ipaenabledflag": [
+ "FALSE"
+ ],
+ "ipaselinuxuser": [
+ "xguest_u:s0"
+ ],
+ "ipauniqueid": [
+ "dbe2ffa0-3c2c-11e1-ad81-00163e6185c4"
+ ],
+ "memberuser_user": [
+ "karel"
+ ],
+ "objectclass": [
+ "ipaassociation",
+ "ipaselinuxusermap"
+ ]
+ },
+ "summary": null,
+ "value": "test01"
}
]
}
diff --git a/install/ui/test/data/sudorule_find_pkeys.json b/install/ui/test/data/sudorule_find_pkeys.json
index a72894db..139fc0a2 100644
--- a/install/ui/test/data/sudorule_find_pkeys.json
+++ b/install/ui/test/data/sudorule_find_pkeys.json
@@ -6,7 +6,13 @@
"result": [
{
"cn": [
- "test"
+ "test01"
+ ],
+ "dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=example,dc=com"
+ },
+ {
+ "cn": [
+ "test02"
],
"dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=example,dc=com"
}
diff --git a/install/ui/test/data/sudorule_get_records.json b/install/ui/test/data/sudorule_get_records.json
index 7e1d09cc..e005dfea 100644
--- a/install/ui/test/data/sudorule_get_records.json
+++ b/install/ui/test/data/sudorule_get_records.json
@@ -33,7 +33,10 @@
"usercategory": "rscwo"
},
"cn": [
- "test"
+ "test01"
+ ],
+ "description": [
+ "Test Sudo Rule 01"
],
"dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=example,dc=com",
"externalhost": [
@@ -90,7 +93,98 @@
]
},
"summary": null,
- "value": "test"
+ "value": "test01"
+ },
+ {
+ "error": null,
+ "result": {
+ "attributelevelrights": {
+ "aci": "rscwo",
+ "cmdcategory": "rscwo",
+ "cn": "rscwo",
+ "description": "rscwo",
+ "externalhost": "rscwo",
+ "externaluser": "rscwo",
+ "hostcategory": "rscwo",
+ "hostmask": "rscwo",
+ "ipaenabledflag": "rscwo",
+ "ipasudoopt": "rscwo",
+ "ipasudorunas": "rscwo",
+ "ipasudorunasextgroup": "rscwo",
+ "ipasudorunasextuser": "rscwo",
+ "ipasudorunasgroup": "rscwo",
+ "ipasudorunasgroupcategory": "rscwo",
+ "ipasudorunasusercategory": "rscwo",
+ "ipauniqueid": "rsc",
+ "memberallowcmd": "rscwo",
+ "memberdenycmd": "rscwo",
+ "memberhost": "rscwo",
+ "memberuser": "rscwo",
+ "nsaccountlock": "rscwo",
+ "usercategory": "rscwo"
+ },
+ "cn": [
+ "test02"
+ ],
+ "description": [
+ "Test Sudo Rule 02"
+ ],
+ "dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=example,dc=com",
+ "externalhost": [
+ "external.example.com"
+ ],
+ "externaluser": [
+ "external"
+ ],
+ "ipaenabledflag": [
+ "FALSE"
+ ],
+ "ipasudoopt": [
+ "-H",
+ "-b"
+ ],
+ "ipasudorunas_user": [
+ "admin"
+ ],
+ "ipasudorunasgroup_group": [
+ "admins"
+ ],
+ "ipauniqueid": [
+ "4fc57a02-f23311df-b268e50e-a3b3ef71"
+ ],
+ "memberallowcmd_sudocmd": [
+ "/usr/bin/less"
+ ],
+ "memberallowcmd_sudocmdgroup": [
+ "group1"
+ ],
+ "memberdenycmd_sudocmd": [
+ "/usr/bin/more"
+ ],
+ "memberdenycmd_sudocmdgroup": [
+ "group1",
+ "group2"
+ ],
+ "memberhost_host": [
+ "dev.example.com"
+ ],
+ "memberhost_hostgroup": [
+ "production",
+ "staging"
+ ],
+ "memberuser_group": [
+ "editors"
+ ],
+ "memberuser_user": [
+ "test"
+ ],
+ "objectclass": [
+ "ipaassociation",
+ "ipasudorule"
+ ]
+ },
+ "summary": null,
+ "value": "test02"
}
]
}
diff --git a/install/ui/test/data/user_get_records.json b/install/ui/test/data/user_get_records.json
index c45a45c6..8814bff7 100644
--- a/install/ui/test/data/user_get_records.json
+++ b/install/ui/test/data/user_get_records.json
@@ -610,7 +610,7 @@
"mepmanagedentry": [
"cn=aortega,cn=groups,cn=accounts,dc=example,dc=com"
],
- "nsaccountlock": false,
+ "nsaccountlock": true,
"objectclass": [
"top",
"person",
@@ -681,7 +681,7 @@
"mepmanagedentry": [
"cn=aortiz,cn=groups,cn=accounts,dc=example,dc=com"
],
- "nsaccountlock": false,
+ "nsaccountlock": true,
"objectclass": [
"top",
"person",
@@ -1107,7 +1107,7 @@
"mepmanagedentry": [
"cn=bbauer,cn=groups,cn=accounts,dc=example,dc=com"
],
- "nsaccountlock": false,
+ "nsaccountlock": true,
"objectclass": [
"top",
"person",
diff --git a/install/ui/user.js b/install/ui/user.js
index 68122834..92ac86a8 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -36,6 +36,7 @@ IPA.user.entity = function(spec) {
var link = self_service ? false : undefined;
that.builder.search_facet({
+ row_disabled_attribute: 'nsaccountlock',
columns: [
'uid',
'givenname',
@@ -45,7 +46,8 @@ IPA.user.entity = function(spec) {
format: IPA.boolean_format({
true_value: IPA.messages.objects.user.active,
false_value: IPA.messages.objects.user.inactive,
- invert_value: true
+ invert_value: true,
+ show_false: true
}),
label: IPA.messages.objects.user.account_status
},
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 4972372c..85d9282c 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -947,6 +947,12 @@ IPA.format = function(spec) {
var that = {};
+ // parse attribute value into a normalized value
+ that.parse = function(value) {
+ return value;
+ };
+
+ // format normalized value
that.format = function(value) {
return value;
};
@@ -965,7 +971,8 @@ IPA.boolean_format = function(spec) {
that.show_false = spec.show_false;
that.invert_value = spec.invert_value;
- that.format = function(value) {
+ // convert string boolean value into real boolean value, or keep the original value
+ that.parse = function(value) {
if (value === undefined || value === null) return '';
@@ -985,7 +992,15 @@ IPA.boolean_format = function(spec) {
if (typeof value === 'boolean') {
if (that.invert_value) value = !value;
+ }
+ return value;
+ };
+
+ // convert boolean value into formatted string, or keep the original value
+ that.format = function(value) {
+
+ if (typeof value === 'boolean') {
if (value) {
value = that.true_value;
@@ -1035,6 +1050,7 @@ IPA.column = function (spec) {
var value = record[that.name];
if (that.format) {
+ value = that.format.parse(value);
value = that.format.format(value);
}
value = value ? value.toString() : '';
@@ -1482,6 +1498,16 @@ IPA.table_widget = function (spec) {
that.setup_column(column, div, record);
}
+
+ return tr;
+ };
+
+ that.set_row_enabled = function(tr, enabled) {
+ if (enabled) {
+ tr.removeClass('disabled');
+ } else {
+ tr.addClass('disabled');
+ }
};
that.setup_column = function(column, div, record) {