[Rails] cancan gem being replaced

2014-03-25 Thread mike2r
I just came across this so I thought I would post it on this board since I see cancan come up a lot. It seems that Ryan Bates (who is primarily responsible for cancan) is taking a hiatus and the gem is no longer being actively maintained. The collaborators on that gem have formed a new team

[Rails] CanCan: How to define ability with some conditions

2014-02-16 Thread Роман Ярыгин
Hello everyone! I have code: if user.role == topmanager can :read, ActiveAdmin::Page, :name = Dashboard can :manage, Realty, agent: {agency_id: user.agency_id} ... And I want to add another condition, can :manage, Realty, agent: nil How to do it? Defining it two times gets

[Rails] Cancan Rspec load_and_authorize_resource

2013-11-22 Thread Sasha Babich
Hello! While running bundle exec rake, I receive following error (see in attached file) However, my tests are steel passing with command rspec spec/controllers/ Some info: ads_controller.rb: class AdsController ApplicationController load_and_authorize_resource except: :create end

[Rails] cancan roles issue

2013-07-01 Thread Phil
Rails 3.2.11 Ruby 2 Hi, I am building my first rails app and decided to use Devise(2.2.4) and Cancan(1.6.10) for auth and role management. The auth part works nicely but I haven't been able to get cancan working correctly. I have one role setup(admin). But when I try view the users index

Re: [Rails] cancan roles issue

2013-07-01 Thread Walter Lee Davis
On Jul 1, 2013, at 6:22 PM, Phil wrote: Rails 3.2.11 Ruby 2 Hi, I am building my first rails app and decided to use Devise(2.2.4) and Cancan(1.6.10) for auth and role management. The auth part works nicely but I haven't been able to get cancan working correctly. I have one role

[Rails] CANCAN and angular

2013-04-15 Thread Filip Matošić
I am a fairly new Rails developer, allso i begun to develop with angular as it gives sense and clarity. I have come up to a bit of a problem. I use CANCAN to manage user-role wrights, but now it gives me a very hard time to implement with angular in cases where i have a repeater, as i need to

Re: [Rails] Cancan question - create rule issue

2012-11-15 Thread Ace Suares
I Think a validation will only work after data is entered. With authorization (as in CanCan) the possibility of creating a new proposal can be avoided all together. I did some experiments but yes, it's possible to put extra arguments into the initialize method. For instance, initialize(user,

Re: [Rails] Cancan question - create rule issue

2012-11-14 Thread Colin Law
On 13 November 2012 23:07, Stan McFarland stan.mcfarl...@blackoakweb.com wrote: Hi, RoR newbie here. Fairly new, anyway. :). I have a cancan question I'm hoping someone can help me with. I have two models - ProposalRequest and Proposal.Each ProposalRequest can have many Proposals, but

[Rails] Cancan question - create rule issue

2012-11-13 Thread Stan McFarland
Hi, RoR newbie here. Fairly new, anyway. :). I have a cancan question I'm hoping someone can help me with. I have two models - ProposalRequest and Proposal.Each ProposalRequest can have many Proposals, but a given user can submit only one Proposal for each ProposalRequest. I can't

[Rails] CanCan load_resource get a nil resource

2012-10-15 Thread enrico stano
Hi, I've opened a question on StackOverflow regarding #load_resources and a create action in UserController: http://stackoverflow.com/questions/12882284/load-resource-get-a-nil-resource Could anyone please give me some hints? thank you! enrico -- · Enrico Stano · · twitter @enricostano ·

Re: [Rails] cancan

2012-10-08 Thread Avi
Thanks for the reply. How cancan can be used for restricting the methods in controllers which has no models ? On Friday, October 5, 2012 8:18:24 PM UTC+5:30, Walter Lee Davis wrote: On Oct 5, 2012, at 7:46 AM, Avi wrote: Hello All, Does cancan works without fetching roles data from

Re: [Rails] cancan

2012-10-08 Thread Walter Lee Davis
On Oct 8, 2012, at 3:32 AM, Avi wrote: Thanks for the reply. How cancan can be used for restricting the methods in controllers which has no models ? By dealing with the model that represents current_user or its local equivalent. The controller in question does not have to be the

Re: [Rails] cancan

2012-10-08 Thread Jordon Bedwell
On Mon, Oct 8, 2012 at 6:59 AM, Walter Lee Davis wa...@wdstudio.com wrote: By dealing with the model that represents current_user or its local equivalent. The controller in question does not have to be the UsersController by any means, as long as you have authenticated at some point, and

[Rails] cancan

2012-10-05 Thread Avi
Hello All, Does cancan works without fetching roles data from db? Can we give permissions accordingly? Can we configure those roles like enum classes in java or in any config file? Thanks -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

Re: [Rails] cancan

2012-10-05 Thread Walter Lee Davis
On Oct 5, 2012, at 7:46 AM, Avi wrote: Hello All, Does cancan works without fetching roles data from db? Can we give permissions accordingly? Can we configure those roles like enum classes in java or in any config file? The default setup (all I've ever done) is to configure the various

[Rails] cancan and authorization on controller actions of a gem.

2012-10-02 Thread Mauro
Hello. I've installed cancan and bigbluebutton_rails, https://github.com/mconf/bigbluebutton_rails. The gem bigbluebutton_rails has some models and controllers, for example has bigbluebutton/servers_controller.rb. This controller has some actions like create, join, authorize, etc. I want that only

Re: [Rails] cancan authorization

2012-09-21 Thread Avi
Thanks Jim. On Friday, September 21, 2012 10:47:03 AM UTC+5:30, jim wrote: On Fri, Sep 21, 2012 at 2:57 PM, Avi aavinas...@gmail.com javascript:wrote: Is cancan is only used for CRUD operations? Can we use it while navigating a page or any other functionality other than CRUD

[Rails] cancan authorization

2012-09-20 Thread Avi
Is cancan is only used for CRUD operations? Can we use it while navigating a page or any other functionality other than CRUD operations? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to

Re: [Rails] cancan authorization

2012-09-20 Thread Jim Ruther Nill
On Fri, Sep 21, 2012 at 2:57 PM, Avi aavinash.beh...@gmail.com wrote: Is cancan is only used for CRUD operations? Can we use it while navigating a page or any other functionality other than CRUD operations? yep. look at https://github.com/ryanb/cancan/wiki/Authorizing-controller-actions

[Rails] cancan breaks scoped mass assignment

2012-03-30 Thread Serafino Picozzi
Hi all, I just installed cancan on a new project and found out that it creates some problems with the new scoped mass assignment features of rails 3.2 . Basically, in my User model I create some attr_accessible attributes in order to avoid users to edit their roles or other sensitive

[Rails] CanCan is leaving numbers in my views

2012-03-23 Thread scott
I have a rail app setup with devise and i am now adding cancan. The problem i am having is that where ever i have can? in my views, it adds a number. It only does this if the user does have the permission for the action. Everything else is working perfectly, it's just these annoying numbers!

Re: [Rails] CanCan is leaving numbers in my views

2012-03-23 Thread Raul Sanchez
Hi Yo should write as this: @clubs.each do |club| %tr %td= club.name %td= link_to 'Show', club - if can? :update, club %td= link_to 'Edit', edit_club_path(club) - if can? :destroy, club %td= link_to 'Destroy', club, :confirm = 'Are you sure?', :method =

[Rails] Cancan gem help .. as I Can..not ;-)

2012-01-25 Thread Erwin
I'll be grateful to any cancan guru to give me some advice on how to formulate the abilities in a structure with associations ... I have the following tree association : Subdomain (has_one) Portfolio (has_many) Projects (has_many) Payments Subdomain (has_many) Users (w roles) I want a

[Rails] CanCan doesn't work on this model

2011-08-08 Thread Leonel *.*
--- ability.rb --- can :update, User, :auth_token = current_user.auth_token ---

[Rails] CanCan filtering meta_search results?

2011-07-27 Thread Walter Lee Davis
At the moment, I am running meta_search, and then filtering through CanCan after I have a set of results. Is there any other way to restrict the returned objects within the initial search query? def index @search = User .search

[Rails] CanCan with Devise Invitable

2011-06-30 Thread Walter Lee Davis
Has anyone used this combination before? I am curious how I am going to enforce my authorization rules beyond the view layer w/r/t invitations. Certain groups of users will be able to invite new users, but most will not. When one group of users makes invitations, that magically sets the

[Rails] Cancan redirect back at AccessDenied

2011-06-05 Thread Yiannis
Hello I have a rails 3 app and I am trying to implement the redirect back action at access denied for cancan. If I try this in my application_controller: rescue_from CanCan::AccessDenied do |exception| redirect_to :back end It gives the following error: No HTTP_REFERER was set in

[Rails] cancan include issue

2011-06-01 Thread Me
I have a Rails 2.3.4 app that uses cancan, but when I try to go to the index page I get: I see the gem when I do a gem list, ideas? uninitialized constant Authorization::ControllerMethods::CanCan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] cancan include issue

2011-06-01 Thread Bryan Crossland
On Wed, Jun 1, 2011 at 12:39 PM, Me chabg...@gmail.com wrote: I have a Rails 2.3.4 app that uses cancan, but when I try to go to the index page I get: I see the gem when I do a gem list, ideas? uninitialized constant Authorization::ControllerMethods::CanCan Have you required the gem in

[Rails] CanCan issue when being very specific

2010-12-02 Thread Leonel *.*
So I got CanCan and Devise working well. I have two types of users: Admins and Nonadmins. Admins can edit all of Nonadmins profiles. The problem is, every user (either Admin or Nonadmin) belongs to an Account or Organization. Admins should only be able to edit users from their own Account or

Re: [Rails] CanCan issue when being very specific

2010-12-02 Thread Joshua Martin
What message are you getting? On Thu, Dec 2, 2010 at 9:28 AM, Leonel *.* li...@ruby-forum.com wrote: So I got CanCan and Devise working well. I have two types of users: Admins and Nonadmins. Admins can edit all of Nonadmins profiles. The problem is, every user (either Admin or Nonadmin)

[Rails] CanCan gem help required

2010-11-23 Thread NazarHussain
Hi to all. How can we specify access to the some specific method of a controller. like we can specify things like: can :manage, User if user have two custom methods like , method1 and method2 and i want to give access to method1 but not to method2 How can i do so? Waiting for someones

[Rails] Cancan, how to allow artists to edit their own

2010-10-12 Thread Christian Fazzini
What am I doing wrong here? I am using cancan on Rails 3. In my Ability class, I've got: class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user, for users who are not registered or don't have an account yet if user.role? :admin can :manage,

[Rails] CanCan questions

2010-04-28 Thread Michael Pavling
I've used Aegis in the past for role-based authorisation, but have seen a lot of talk about CanCan; so I thought I'd give it a go and have been fiddling with it over the last couple of days. It seems to have a slightly nicer DSL and simpler implementation for authorising CRUD operations, but I'm