Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7491103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:52:31+00:00 2026-05-29T15:52:31+00:00

Because anyone can sign up and then log in,… and because a user isn’t

  • 0

Because anyone can sign up and then log in,… and because a user isn’t identified for roles until after log in, doesn’t it make sense to skip authorization_check for Devise?

Going on that premise, i inherit from the Devise registration controller with this registrations_controller and placed it in the controller directory.

class Users::RegistrationsController < Devise::RegistrationsController
  skip_authorization_check
end

change to the routes file:

devise_for :users, :controllers => { :registrations => "registrations" }

I’m missing something though:

This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:52:31+00:00Added an answer on May 29, 2026 at 3:52 pm

    The easy solution

    check_authorization :unless => :devise_controller?
    

    If you have to put check_authorization in every controller manually at some point you will forget and open a security hole in your app. It’s better to explicitly whitelist controllers that don’t need auth by cancan.

    This is made clear in the CANCAN docs at

    https://github.com/ryanb/cancan/wiki/Ensure-Authorization

    EDIT

    class ApplicationController < ActionController::Base
      check_authorization :unless => :do_not_check_authorization?
      private
      def do_not_check_authorization?
        respond_to?(:devise_controller?) or
        condition_one? or
        condition_two?
      end
    
      def condition_one?
       ...
      end
    
      def condition_two?
       ...
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can Anyone help me why x2 prints zero. I guess because of floating point
Two libraries for Mysql. I've always used _mysql because it's simpler. Can anyone tell
Anyone know a tool I can use to debug cannot access the file because
Can any one differentiate Fragments and shared preferences on android. Because, Right now i
I'm trying to search Netflix through their API, but without logging anyone in (because
Anyone know the list of available application/… media types? It is because my website
Because shells other than ksh do not support pass-by-reference, how can multiple arrays be
I'm making a website with a page where users can sign up to win
I'm currently implementing some shims for the ES6 draft. I'm wondering if anyone can
I want to be able to log when a user ends their session on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.