def deny_access(flash_message = nil)
      respond_to do |format|
        format.any(:js, :json, :xml) { head :unauthorized }
        format.any { redirect_request(flash_message) }
      end
    end
def deny_access(flash_message = nil)
      respond_to do |format|
        format.any(:js, :json, :xml) { head :unauthorized }
        format.any { redirect_request(flash_message) }
      end
    end
Responds to unauthorized requests in a manner fitting the request format.
 `js`, `json`, and `xml` requests will receive a 401 with no body. All
 other formats will be redirected appropriately and can optionally have the
 flash message set.

 When redirecting, the originally requested url will be stored in the
 session (`session[:return_to]`), allowing it to be used as a redirect url
 once the user has successfully signed in.

 If there is a signed in user, the request will be redirected according to
 the value returned from {#url_after_denied_access_when_signed_in}.

 If there is no signed in user, the request will be redirected according to
 the value returned from {#url_after_denied_access_when_signed_out}.
 For the exact redirect behavior, see {#redirect_request}.

 @param [String] flash_message