Questions tagged [cancan]

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

CanCan is an authorization library for Ruby on Rails which restricts what resources a given user is allowed to access.

CanCan uses a model to define the abilities of a user. Inside the class you declare what a user can and cannot do by using the “can” method. From your controllers you use the "can?" method to test the current user's authorization.

As development on CanCan is no longer active, it has been continued on under the new name CanCanCan.

Wiki

1405 questions
0
votes
1 answer

Rails superuser resource context

The app I'm working on revolves around users belonging to organisations, and only being able to access resources in those organisations. That much is fine, and pretty straight forward. The system also has users outside of any organisation, who are…
PaReeOhNos
  • 4,338
  • 3
  • 30
  • 41
0
votes
1 answer

Show and hide based on user role in rails

I have the following code in my home.html.erb file; <% if user_signed_in? %>
want to work on this?