diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2012-05-25 08:57:47 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2012-06-04 11:26:28 +0200 |
commit | 27b1dace2debe8385ee6193dc8830c656dc48764 (patch) | |
tree | 4c5bc807edfd9ea6310aebeeb6178ec2f14cb99a /install/ui/details.js | |
parent | 870627de9a6bf0d0731843ea3305aad3a739cac4 (diff) | |
download | freeipa-27b1dace2debe8385ee6193dc8830c656dc48764.tar.gz freeipa-27b1dace2debe8385ee6193dc8830c656dc48764.tar.xz freeipa-27b1dace2debe8385ee6193dc8830c656dc48764.zip |
Removal of illegal options in JSON-RPC calls
Ticket https://fedorahosted.org/freeipa/ticket/2509 bans using non existent options. If such option is supplied command ends with error. It uncovered several cases in Web UI. This patch is fixing these cases.
Automember, Self-service and Delegation don't support 'pkey-only', 'size-limit' and 'rights' option. Pagination and rights check were disabled for them.
Automount map adder dialog was sending options for indirect map even if chosen type was direct (when those for indirect was filled earlier), also it was sending non-existant 'method' option.
https://fedorahosted.org/freeipa/ticket/2760
Diffstat (limited to 'install/ui/details.js')
-rw-r--r-- | install/ui/details.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/install/ui/details.js b/install/ui/details.js index 4239f6547..d5f6bfc80 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -266,6 +266,7 @@ IPA.details_facet = function(spec, no_init) { that.entity = IPA.get_entity(spec.entity); that.update_command_name = spec.update_command_name || 'mod'; that.command_mode = spec.command_mode || 'save'; // [save, info] + that.check_rights = spec.check_rights !== undefined ? spec.check_rights : true; that.label = spec.label || IPA.messages && IPA.messages.facets && IPA.messages.facets.details; that.facet_group = spec.facet_group || 'settings'; @@ -531,14 +532,15 @@ IPA.details_facet = function(spec, no_init) { that.create_fields_update_command = function(update_info) { var args = that.get_primary_key(); + + var options = { all: true }; + if (that.check_rights) options.rights = true; + var command = IPA.command({ entity: that.entity.name, method: that.update_command_name, args: args, - options: { - all: true, - rights: true - } + options: options }); //set command options @@ -623,11 +625,14 @@ IPA.details_facet = function(spec, no_init) { that.create_refresh_command = function() { + var options = { all: true }; + if (that.check_rights) options.rights = true; + var command = IPA.command({ name: that.get_refresh_command_name(), entity: that.entity.name, method: 'show', - options: { all: true, rights: true } + options: options }); if (that.pkey) { |