diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-01-08 17:34:24 +0100 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-02-12 17:11:17 +0100 |
commit | 15995d1f389c37e7842471d890498a25f3f226da (patch) | |
tree | 8abb1992ef07f0d681ae8edf2235796487198e6b | |
parent | 419f3ad62728e12ecf7c3a25211397a5615960b9 (diff) | |
download | freeipa.git-15995d1f389c37e7842471d890498a25f3f226da.tar.gz freeipa.git-15995d1f389c37e7842471d890498a25f3f226da.tar.xz freeipa.git-15995d1f389c37e7842471d890498a25f3f226da.zip |
permission plugin: Convert options in execute, not args_options_2_params
With this change, shortcut options like memberof and type will be
aplied on the server, not on the client.
This will allow us to pass more information than just updated options.
Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rw-r--r-- | ipalib/plugins/permission.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/ipalib/plugins/permission.py b/ipalib/plugins/permission.py index d8ca78f7..00825e55 100644 --- a/ipalib/plugins/permission.py +++ b/ipalib/plugins/permission.py @@ -692,14 +692,11 @@ class permission_add(baseldap.LDAPCreate): msg_summary = _('Added permission "%(value)s"') has_output_params = baseldap.LDAPCreate.has_output_params + output_params - # Need to override args_options_2_params so that processed options apply to + # Need to override execute so that processed options apply to # the whole command, not just the callbacks - def args_options_2_params(self, *args, **options): - if self.env.in_server: - self.obj.preprocess_options(options) - - return super(permission_add, self).args_options_2_params( - *args, **options) + def execute(self, *keys, **options): + self.obj.preprocess_options(options) + return super(permission_add, self).execute(*keys, **options) def pre_callback(self, ldap, dn, entry, attrs_list, *keys, **options): entry['ipapermissiontype'] = ['SYSTEM', 'V2'] @@ -755,12 +752,9 @@ class permission_mod(baseldap.LDAPUpdate): msg_summary = _('Modified permission "%(value)s"') has_output_params = baseldap.LDAPUpdate.has_output_params + output_params - def args_options_2_params(self, *args, **options): - if self.env.in_server: - self.obj.preprocess_options(options) - - return super(permission_mod, self).args_options_2_params( - *args, **options) + def execute(self, *keys, **options): + self.obj.preprocess_options(options) + return super(permission_mod, self).execute(*keys, **options) def pre_callback(self, ldap, dn, entry, attrs_list, *keys, **options): if 'rename' in options and not options['rename']: @@ -855,12 +849,9 @@ class permission_find(baseldap.LDAPSearch): '%(count)d permission matched', '%(count)d permissions matched', 0) has_output_params = baseldap.LDAPSearch.has_output_params + output_params - def args_options_2_params(self, *args, **options): - if self.env.in_server: - self.obj.preprocess_options(options) - - return super(permission_find, self).args_options_2_params( - *args, **options) + def execute(self, *keys, **options): + self.obj.preprocess_options(options) + return super(permission_find, self).execute(*keys, **options) def post_callback(self, ldap, entries, truncated, *args, **options): attribute_options = [o for o in options |