def validate_params

      if params[:encrypted_password].nil? or params[:shared_user_ids].nil? or params[:board].nil?
        render json: {}, status: 422
        return
      end

      result = has_board_access(params[:board][:id])
      if result[:status] != :ok
        render json: {}, status: result[:status]
        return
      else
        if !result[:user_board].is_admin
          render json: {}, status: :forbidden
          return
        end
        @board = result[:board]
        @user_board = result[:user_board]
      end

      if params[:posts]

        params[:posts].each do |post|
          s = has_post_access(params[:board][:id], post[:id])[:status]
          if s != :ok
            render json: {}, status: s
            return
          end

          if post[:comments]
            post[:comments].each do |comment|
              s = has_comment_access(post[:id], comment[:id])[:status]
              if s != :ok
                render json: {}, status: s
                return
              end
            end
          end

        end

      end

    end
def validate_params

      if params[:encrypted_password].nil? or params[:shared_user_ids].nil? or params[:board].nil?
        render json: {}, status: 422
        return
      end

      result = has_board_access(params[:board][:id])
      if result[:status] != :ok
        render json: {}, status: result[:status]
        return
      else
        if !result[:user_board].is_admin
          render json: {}, status: :forbidden
          return
        end
        @board = result[:board]
        @user_board = result[:user_board]
      end

      if params[:posts]

        params[:posts].each do |post|
          s = has_post_access(params[:board][:id], post[:id])[:status]
          if s != :ok
            render json: {}, status: s
            return
          end

          if post[:comments]
            post[:comments].each do |comment|
              s = has_comment_access(post[:id], comment[:id])[:status]
              if s != :ok
                render json: {}, status: s
                return
              end
            end
          end

        end

      end

    end
Validates the contents of params against the database records.