summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/acl_endpoint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/endpoints/acl_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/acl_endpoint.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef_zero/endpoints/acl_endpoint.rb b/lib/chef_zero/endpoints/acl_endpoint.rb
index f1c0013..cca8392 100644
--- a/lib/chef_zero/endpoints/acl_endpoint.rb
+++ b/lib/chef_zero/endpoints/acl_endpoint.rb
@@ -1,4 +1,4 @@
-require 'json'
+require 'ffi_yajl'
require 'chef_zero/rest_base'
require 'chef_zero/chef_data/acl_path'
@@ -28,9 +28,9 @@ module ChefZero
def put(request)
path, perm = validate_request(request)
- acls = JSON.parse(get_data(request, path), :create_additions => false)
- acls[perm] = JSON.parse(request.body, :create_additions => false)[perm]
- set_data(request, path, JSON.pretty_generate(acls))
+ acls = FFI_Yajl::Parser.parse(get_data(request, path), :create_additions => false)
+ acls[perm] = FFI_Yajl::Parser.parse(request.body, :create_additions => false)[perm]
+ set_data(request, path, FFI_Yajl::Encoder.encode(acls, :pretty => true))
json_response(200, {'uri' => "#{build_uri(request.base_uri, request.rest_path)}"})
end
end