cancancan Questions
3
Solved
I am getting an unexpected behaviour for a simple cancancan authorization.
ability.rb
class Ability
include CanCan::Ability
def initialize(user)
# Define abilities for the passed in user here...
Midshipman asked 11/7, 2017 at 15:7
4
Solved
I've the following Ability:
can :manage, ActiveAdmin::Page, name: 'My Page'
And it is working fine, but I want to check if the user has the ability to manage this ActiveAdmin::Page in different ...
Annam asked 25/1, 2017 at 11:13
1
Background
I have a simple app with devise and cancancan. Because I wanted to add a little bit of custom logic to the signup process, I used devise with customised controllers, which simply means d...
Scend asked 25/10, 2020 at 5:39
2
Solved
I am using rails 5, rails_admin, devise and cancancan.
Everything works correctly, but when there is access denied, it shows a 'You are not authorized to access this page' error screen.
I want to...
Claudiaclaudian asked 2/11, 2016 at 18:52
1
I am using Trestle Admin, this is my route:
trestle_path /admin Trestle::Engine
When a user that is not an admin visits the /admin route, I would like CanCanCan to handle it like it handles all ...
Retha asked 31/3, 2019 at 6:23
2
Solved
I'm having some trouble getting ActiveAdmin to work with CanCanCan. I'm using CanCanCan version 1.9.2 and ActiveAdmin version 1.0.0.pre in a Rails 4 app. After setting up my ability class and enabl...
Practical asked 6/10, 2014 at 22:10
3
In my ability.rb, I have the following rule:
elsif user.has_role? :demo
can :read, Profile, demo_featured: true, demo_linked: true, message: "To access this profile, please subscribe here."
But...
Flammable asked 12/12, 2016 at 7:42
1
Solved
I have a problem with unit testing in ruby on rails (rails v. 5.001). I use devise and cancancan for authorization. The user needs to login in a test unit, but how can I implement this without redi...
Endoergic asked 5/12, 2016 at 12:55
1
Solved
I'm attempting to setup the rolify gem and I'm running into an issue assigning a role to a user in the console.
Here's my error:
2.2.1 :007 > user.add_role :admin
ArgumentError: Unknown key: ...
Bagdad asked 22/3, 2016 at 1:50
3
Solved
I want to give rights to users in my rails app. I have 'admin' who can create, update and delete all posts and comments, 'user' who can create and update only his own comments, and 'guest' who can ...
Griceldagrid asked 8/12, 2014 at 11:33
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
1
© 2022 - 2024 — McMap. All rights reserved.