  def create
    exists = true 
    if params.has_key?(:inflated_object)
      params[:name] ||= params[:inflated_object].name
      # We can only get here if we're admin or the validator. Only
      # allow creating admin clients if we're already an admin.
      if @auth_user.admin
        params[:admin] ||= params[:inflated_object].admin
      else
        params[:admin] = false
      end
    end

    begin
      Chef::ApiClient.cdb_load(params[:name])
    rescue Chef::Exceptions::CouchDBNotFound
      exists = false 
    end
    raise Conflict, "Client already exists" if exists

    @client = Chef::ApiClient.new
    @client.name(params[:name])
    @client.admin(params[:admin]) if params[:admin]
    @client.create_keys
    @client.cdb_save
    
    self.status = 201
    headers['Location'] = absolute_url(:client, @client.name)
    display({ :uri => absolute_url(:client, @client.name), :private_key => @client.private_key })
  end
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.