cancan 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

3

Solved

I am using Bootstrap, which has div class="alert notice" that has a bunch of classes for various notice messages. I also have an AJAX destroy action for a comment, that I have added cancan authori...

4

Solved

I'm using CanCan for authorization. I define the model-action-user rules in /app/config/ability.rb and it's working fine. I've added the line load_and_authorize_resource to my application_controlle...
Wellhead asked 29/6, 2012 at 6:19

2

Solved

I have problem with CanCan gem which I can't solve. In my controller I have action "confirm" which is a member route for "reservations" resource. I don't want to authorize resource by CanCan in thi...
Blanket asked 27/6, 2014 at 4:59

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

3

Everyone I was wondering if anyone knows of any Java libraries that are similar to or offer the same functionality as CanCan (Ruby on Rails). Would love to know your experiences with them if any. ...
Puca asked 13/6, 2011 at 8:24

4

Solved

I'm using rails 3.0.9, cancan 1.6.7 and devise 1.4.8 I'm using two devise models(User and Admin) for different log-in and registration process So I want to divide the abilities depend upon the l...
Aalborg asked 5/10, 2012 at 14:7

3

Solved

Trying to set up Cancan within an app of mine and having trouble with my PostsController. In a nutshell, when a Post is created I'd like it associated with the current_user so my create action lo...
Fredel asked 10/8, 2011 at 17:42

6

Solved

I was trying to test a simple index view, which has following code inside: - if can? :destroy, MyModel %th Options MyModelsController has following options (Inherited Resources + CanCan + Devis...
Sheldonshelduck asked 16/2, 2011 at 15:28

2

Is it possible to define abilities in separate file and include them in ability.rb file inside initialize method ? belowed code returns: tried and got: undefined method 'can' ability.rb def init...
Philis asked 12/10, 2011 at 10:5

2

Solved

Have somebody tried to rewrite CanCan ActiverRecordAddtions for Mongoid http://github.com/ryanb/cancan/blob/master/lib/cancan/active_record_additions.rb Regards, Alexey Zakharov
Isidoro asked 23/9, 2010 at 8:51

1

Solved

I use rails 5.0 cancan 1.6.10 devise 4.2.0 Activeadmin I regulary have this error in newrelic : NoMethodError: undefined method `access_denied' for #<Admin::FollowupsController:0x007f112917d...
Aghast asked 9/11, 2017 at 13:12

6

Solved

If I have a Devise model User, of which only those users with role :admin are allowed to view a certain url, how can I write an RSpec integration test to check that the status returns 200 for that ...
Dorinedorion asked 3/5, 2011 at 5:48

3

Solved

I am writing a rails application for an organization. Every user may have 1 or more roles and can only access certain controller actions depending on those roles. For example, only admins can crea...
Reverberate asked 12/8, 2014 at 19:51

5

I am looking for NuGet package that provides similar functionality as the CanCan gem in rails ( https://github.com/ryanb/cancan ). Does anyone know a plugin that provides a similar functionality?...
Tineid asked 20/6, 2012 at 10:15

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

3

Solved

I have a around 13 models in my rails app, I use ability on all of them. My ability class has grown huge. I have different ability conditions on different CRUD actions which is making it hard to ma...
Serviceberry asked 20/3, 2014 at 11:0

3

Solved

I'm working to implement CanCan. For some reason CanCan keeps giving me Access Denied when I try to get specific about model permissions. And I can't figure out why. Is there a way to get CanCan t...
Santinasantini asked 3/11, 2010 at 16:25

1

Solved

I've spent a while trying figure out the best way to authorize a controller that's from a gem with CanCan. I'm specifically using Comfortable Mexican Sofa. I have it all setup with Devise and CanCa...

5

Solved

I have a Groups Controller with a method def inbox. If the user is a group member then inbox returns a JSON object. If the user is not a member, then inbox should redirect thanks to CanCan permis...
Selfdriven asked 13/5, 2011 at 16:45

1

Solved

I would know how the load_and_authorize_resource works inside. I searched the github page Link and tried to undestand , but i didn't find nothing usefull. I only understand that load_and_authorize_...
Electronics asked 15/6, 2015 at 8:9

2

In my rails application website visitors can sign up and create content. It uses devise with user model and everything works well. Now I want to use rails_admin for managing website resources and ...
Parenthood asked 24/11, 2014 at 10:34

3

Solved

I get that there are a lot of questions on this subject but none have really answered what i'm looking for. I'm attempting to use rolify to define my roles in cancan, i was able to make an admin r...
Biotin asked 5/1, 2014 at 3:20

5

I have an admin controller and I want that only users that are defined as admin would have access to that controller. my ability class: class Ability include CanCan::Ability def initialize(use...
Fisticuffs asked 25/12, 2010 at 12:1

2

Solved

I am using Devise and interested in using Pundit but cannot find much on if it should be integrating with Rolify or if it is stand alone. CanCanCan works nicely with Rolify and I like the roles mod...
Worried asked 3/10, 2014 at 1:40

© 2022 - 2024 — McMap. All rights reserved.