summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/sudorule.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-05-21 05:03:21 -0400
committerMartin Kosek <mkosek@redhat.com>2012-05-29 09:23:26 +0200
commit1af36da933cd3c788e3a48257e2f5c286e985e22 (patch)
tree472816360fa7ad147e958b63e240f45ed04a72b0 /ipalib/plugins/sudorule.py
parente0930d42a54e586a0170c853fbc9e66f9193d5b0 (diff)
downloadfreeipa-1af36da933cd3c788e3a48257e2f5c286e985e22.tar.gz
freeipa-1af36da933cd3c788e3a48257e2f5c286e985e22.tar.xz
freeipa-1af36da933cd3c788e3a48257e2f5c286e985e22.zip
Disallow setattr on no_update/no_create params
Make --{set,add,del}attr fail on parameters with the no_update/no_create flag for the respective command. For attributes that can be modified, but we just don't want to display in the CLI, use the 'no_option' flag. These are "locking" attributes (ipaenabledflag, nsaccountlock) and externalhost. Document the 'no_option' flag. Add some tests. https://fedorahosted.org/freeipa/ticket/2580
Diffstat (limited to 'ipalib/plugins/sudorule.py')
-rw-r--r--ipalib/plugins/sudorule.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py
index 2c0358e87..723cce2e4 100644
--- a/ipalib/plugins/sudorule.py
+++ b/ipalib/plugins/sudorule.py
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipalib import api, errors
-from ipalib import Str, StrEnum
+from ipalib import Str, StrEnum, Bool
from ipalib.plugins.baseldap import *
from ipalib.plugins.hbacrule import is_all
from ipalib import _, ngettext
@@ -110,9 +110,9 @@ class sudorule(LDAPObject):
cli_name='desc',
label=_('Description'),
),
- Flag('ipaenabledflag?',
+ Bool('ipaenabledflag?',
label=_('Enabled'),
- flags=['no_create', 'no_update', 'no_search'],
+ flags=['no_option'],
),
StrEnum('usercategory?',
cli_name='usercat',