Restful_authentication + Active_rbac

1 view
Skip to first unread message

Andy Koch

unread,
Oct 10, 2007, 1:01:58 PM10/10/07
to active-rbac
Just to follow up, in case somebody else wonders...

active_rbac plays wonderfully with restful_authentication. Simply
skip the parts about the "acts_as_current_user_container" and
"act_as_encrypts_password".

Go directly to page 5 of the doc book and implement the
"acts_as_user", "acts_as_role" and optional
"acts_as_static_permission".

The only caveat is that you need to comment out the
"attr_protected :roles" in the acts_as_user method since it conflicts
with the attr_accessible directive supplied by restful_auth.

Andy Koch

unread,
Oct 10, 2007, 1:47:11 PM10/10/07
to active-rbac
One more thing,

in the active_rbac.rb file I also commented out the includes that were
not being used - due to restful_auth providing those features...

as in..


# Make ActiveRecord::Base respond to acts_as_encrypts_password.
#require 'active_rbac/acts_as_encrypts_password'
#ActiveRecord::Base.send :extend,
ActsAsEncryptsPassword::ActsAsMethods

# Make ActionController::Base respond to current_user and
current_user=.
#require 'active_rbac/acts_as_current_user_container'
#ActionController::Base.send :extend,
ActsAsCurrentUserContainer::ActsAsMethods

# Make Object respond to acts_as_anonymous_user to classes can be
marked to be
# anonymous user objects.
#require 'active_rbac/acts_as_anonymous_user'
#Object.send :extend, ActsAsAnonymousUser::ActsAsMethods

Just to keep my setup as clean as possible.

weskycn

unread,
Oct 24, 2007, 11:02:16 PM10/24/07
to active-rbac
so good, this help me a lot.
thx

Reply all
Reply to author
Forward
0 new messages