cancan Questions

4

Solved

I am a little confused about how to configure CanCanCan properly. For starters, do I have to add load_and_authorize_resource to every controller resource I want to restrict access to? This is wha...
Honegger asked 11/12, 2014 at 0:21

2

Solved

I am using CanCanCan, Devise & Rolify. My ApplicationController looks like this: class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # Fo...
Rexanna asked 8/12, 2014 at 9:48

2

I'm currently stuck on how to separate roles for CanCan depending on each condition that we want. In our application, there are many categories (such as math, english, history, etc.) and within eac...
Ruffner asked 28/8, 2013 at 8:20

3

Solved

I'm building multi-tenant application. All data isolation is done by TenantID column in each table. What is the best way to automatically handle multi-tenancy for all tenant models. Example: Co...
Sublime asked 23/9, 2010 at 8:34

1

Solved

I'm trying to implement some type of users so ones can edit data and other can only read. user.rb class User < ActiveRecord::Base has_secure_password validates_presence_of :email, :password,...
Table asked 29/5, 2014 at 20:6

3

Solved

How do I serialize permissions with active_model_serializers? I don't have access to current_user or the can? method in models and serializers.

3

How would I go about defining abilities for several devise models?
Ebby asked 18/6, 2012 at 18:25

4

Solved

When it comes to Authorization/Authentication devise + cancan are usually my gems of choice. After the release of Rails4's strong parameters I've been looking into using the cancan_strong_parameter...
Amorphism asked 13/7, 2013 at 13:42

5

Solved

I'm working on a project management app, and in the app, I have project_managers and clients. I'm using Devise and CanCan for authentication/authorization. At what point after login should I be r...
Cordwood asked 20/1, 2011 at 23:28

2

Solved

I'm working on a RoR project and I'm a little confused about this new gem that was recommended for my purposes, Rolify. As I understand it, rolify does pretty much the same thing as CanCan except i...
Messalina asked 27/1, 2014 at 20:54

2

Solved

I'm trying to define a user's ability to access something based on a column on an associated model (so something like can :read, Step, 'steppable' => {published: true}), the problem is that it's...
Theurich asked 19/9, 2013 at 14:3

1

I am developing an app using Devise, Rolify and CanCan. Can I shift it completely to be administered by ActiveAdmin. Is there any documentation for that?
Squeak asked 11/8, 2012 at 18:52

3

Solved

When using the CanCan adapter in ActiveAdmin 0.6.0. I have a resource working and authorization is working. However, when I go to /admin, the root ActiveAdmin page, it redirects to /admin and conti...
Conversational asked 2/7, 2013 at 18:33

4

I setup admin_users that belongs to a customer class (Customer is a company). So Customer has many admin_users. I'm trying to restrict access to Shipment records that belongs to a certain customer...
Atrocity asked 20/1, 2012 at 0:26

1

Solved

I'm doing: can :manage, :all if user.role == 'admin' can :approve, Anuncio do |anuncio| anuncio.try(:aprovado) == false end My second method does not work because the :manage :all override it....
Incommode asked 10/5, 2013 at 17:8

2

I have a standard RESTful controller that uses strong parameters. class UsersController < ApplicationController respond_to :html, :js def index @users = User.all end def show @user = Us...
Tenon asked 6/10, 2012 at 3:34

1

Solved

I'm trying to test how a not logged in user behaves like this describe "not logged in user" do user_no_rights it "can't access action index" do expect(get :index).to raise_error(CanCan::Acces...
Appressed asked 5/5, 2013 at 21:39

2

I'm using cancan and cells gems in my ruby-on-rails project. How to access can? method from within cell? Thanks.
Shelburne asked 5/4, 2011 at 3:32

5

Solved

I'm relatively new to rails (3), and am building an application, using CanCan, where there are 3 tiers of users. Guest - unregistered visitor User registered and logged in visitor Admin - registe...
Tanganyika asked 1/3, 2011 at 17:50

1

Getting following error on calling controller.load_and_authorize_resource protected method `authorize!' called for #<Admin::ProjectsController:0x1405de80> This is happening right after th...
Tace asked 29/3, 2013 at 12:19

3

Solved

I'm using CanCan for permissions in my Rails application in which I have built my own engine for some generic form functionality. I would like to lock down permissions in my system so that users ca...

2

Solved

A User can belong to many Organizations. I would like User to be able to be assigned different roles/authorizations for each of the organization it belongs to. For example, user "kevin" may belon...

1

Solved

I have a requests spec for interactions with the User model. I want to make sure that Users with the Admin role can create/edit/destroy Users. I'm having a problem right now where the Edit action d...
Papistry asked 11/2, 2013 at 15:16

2

Solved

I want to cache a Post view, but the view depends on the permissions of the current user (e.g., I only show the "edit" link if current_user.can?(:edit, @post)) So I'd like my cache key to include ...
Renaud asked 21/3, 2012 at 16:52

1

Solved

I have the following code in my home.html.erb file; <!-- if seeker is logged in show button "Grab it" --> <% if user_signed_in? %> <div class="grabit alignright"> <small>wa...
Narwhal asked 28/12, 2012 at 22:14

© 2022 - 2024 — McMap. All rights reserved.