require_relative "request_parser"

module Devops
  module API3
    module Parser
      class RolesParser < RequestParser

        def create
          create_object_from_json_body
        end

        def policies
          policies = create_object_from_json_body(Array)
          res = Role.check_policies(policies)
          raise Devops::Exception::ValidationError.new(res) unless res.nil?
          policies
        end
      end
    end
  end
end

