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
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
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 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
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
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
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,
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
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
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
·
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
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
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
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.
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
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
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
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
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
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
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!
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 =
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
---
ability.rb
---
can :update, User, :auth_token = current_user.auth_token
---
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
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
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
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
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
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
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)
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
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,
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
34 matches
Mail list logo