From ed649aa21b1fc431e5b9e7b05c2cf21a2b31f957 Mon Sep 17 00:00:00 2001 From: Jr Aquino Date: Tue, 7 Dec 2010 16:09:28 -0800 Subject: [PATCH 2/2] Adding user/host category and ipaenabledflag https://fedorahosted.org/freeipa/ticket/570 This patch Addresses items: 1. The UI needs a rule status with values active & inactive. The CLI doesn't have this attribute. HBAC has ipaenabledflag attribute which can be managed using hbac-enable/disable operations. 2. The UI needs a user category for the "Who" section. The CLI doesn't have this attribute. HBAC has usercategory attribute which can be managed using hbac-add/mod operations. 3. The UI needs a host category for the "Access this host" section. The CLI doesn't have this attribute. HBAC has hostcategory attribute which can be managed using hbac-add/mod operations. --- ipalib/plugins/sudorule.py | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py index ff39fb9..0005e13 100644 --- a/ipalib/plugins/sudorule.py +++ b/ipalib/plugins/sudorule.py @@ -58,6 +58,22 @@ class sudorule(LDAPObject): cli_name='desc', label=_('Description'), ), + Flag('ipaenabledflag?', + label=_('Enabled'), + flags=['no_create', 'no_update', 'no_search'], + ), + StrEnum('usercategory?', + cli_name='usercat', + label=_('User category'), + doc=_('User category the rule applies to'), + values=(u'all', ), + ), + StrEnum('hostcategory?', + cli_name='hostcat', + label=_('Host category'), + doc=_('Host category the rule applies to'), + values=(u'all', ), + ), StrEnum('cmdcategory?', cli_name='cmdcat', label=_('Command category'), -- 1.7.2.3