Top "Cancan" questions

The CanCan gem offers a straight forward and flexible way to define what a user can and cannot do.

How to create the first (Admin) user (CanCan and Devise)?

I made authentication in my Rails 3 app fallowed by Tony's tutorial I don't want public registrations on my app, just …

ruby-on-rails-3 devise cancan
How to do integration testing with RSpec and Devise/CanCan?

If I have a Devise model User, of which only those users with role :admin are allowed to view a …

ruby-on-rails rspec devise cancan
Rails 4 user roles and permissions

I am writing a rails application for an organization. Every user may have 1 or more roles and can only access …

ruby-on-rails ruby ruby-on-rails-4 authorization cancan
How do I create an rspec test that validates a JSON response?

I have a Groups Controller with a method def inbox. If the user is a group member then inbox returns …

json ruby-on-rails-3 testing rspec cancan
Cannot test with rspec controller POST create action( devise and cancan)

I am having difficulty getting a rspec test for a controller to pass. I would like to test that the …

ruby-on-rails rspec devise cancan
How can I redirect a user's home (root) path based on their role using Devise?

I'm working on a project management app, and in the app, I have project_managers and clients. I'm using Devise …

ruby-on-rails authentication routes devise cancan
How can I use RSpec to test the response code on a CanCan failed authorization?

I'm working on a rails project in which I use CanCan to authorize my resources. When a user is not …

rspec controller cancan rspec-rails
How to set up a typical users HABTM roles relationship

I'm quite new to this and I'm using cancan + devise for my user auth. However I'm not really sure what …

ruby-on-rails devise relational-database has-and-belongs-to-many cancan
cancan skip_authorization_check for Devise authentication

Because anyone can sign up and then log in,... and because a user isn't identified for roles until after log …

ruby-on-rails-3 devise cancan
What is the best way to bypass devise authorization for a specific record marked public

I'm using devise and cancan in a Rails 3.2 project. I have an event model with a boolean flag public. If …

ruby-on-rails devise cancan