Forum: Rails Engines why not auto import active_rbac's lib?

9c662bd4110d5913f6bf6e828fd26dd9?d=identicon&s=25 Martin Xu (martinx)
on 2007-03-09 10:22
(Received via mailing list)
I've installed the lasted engines and active_rbac from svnand
configurated
it as the following.

1:edit the routes.rb,and add

>   map.connect '/active_rbac/registration/confirm/:user/:token',
>             :controller => 'active_rbac/registration',
>             :action => 'confirm'
>

2:add config.plugins params in environment/development.rb

> config.plugins = ["engines", "*"]


Then i started the server,but it couldn't find the active_rbac's libThe
codes in vender/plugins/active_rbac/init_engine.rb dosen't take effect.

 the codes is this:

> require 'active_rbac/application_controller_mixin'
> # require the model mixins
> require 'active_rbac/exceptions'
> require 'active_rbac/group_mixin'
> .....
>

So i have to add the following ugly code in Applicaiton.rb

> require_dependency"#{RABC_DIR}lib/active_rbac/user_mixin"
> require_dependency"#{RABC_DIR}lib/active_rbac/user_registration_mixin"
>
> class ApplicationController < ActionController::Base
>   helper RbacHelper
>   # The application controller will give us the "current_user" method.
>   include ActiveRbacMixins::ApplicationControllerMixin



why engines not auto import the active_rbac's lib?
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2007-03-09 10:31
(Received via mailing list)
If ActiveRBAC still comes as an "old-style engine", (i.e. with
init_engine.rb rather than init.rb) then it's likely not compatible
with the 1.2 (latest) engines plugin. This would certainly explain why
the code in init_engine.rb is not evaluated.
9c662bd4110d5913f6bf6e828fd26dd9?d=identicon&s=25 Martin Xu (martinx)
on 2007-03-09 10:37
(Received via mailing list)
Oh,I see,thanks James.
25bbc96d9c53647354cb724e744b2222?d=identicon&s=25 Greg Freemyer (Guest)
on 2007-03-09 20:51
(Received via mailing list)
Did you try the activerbac code from rubyforge?  Supposedly it has
been updated for 1.2

http://rubyforge.org/frs/?group_id=2972

Looks like only 10 downloads so far, so it may not be very tested yet
and I think the upgrade was done by normal user as opposed to the
original author.

If you read https://lists.cloudcore.com/pipermail/rbac-dev/ you will
see that the original author has plans convert activerbac to a
non-engines based solution.

FYI: It is on my todo list to upgrade, but I have not tried it yet.  I
may wait to see if the original author does before I try to decide
which way to go.

Greg

On 3/9/07, martin <martin.xus@gmail.com> wrote:
> > > I've installed the lasted engines and active_rbac from svn,and
> > > 2:add config.plugins params in environment/development.rb
> > > > require 'active_rbac/group_mixin'
> require_dependency"#{RABC_DIR}lib/active_rbac/application_controller_mixin"
> > > >
> > > >   # The application controller will give us the "current_user" method.
> http://lists.rails-engines.org/listinfo.cgi/engine...
> >
> http://lists.rails-engines.org/listinfo.cgi/engine...
> >
>
>
> _______________________________________________
> engine-users mailing list
> engine-users@lists.rails-engines.org
> http://lists.rails-engines.org/listinfo.cgi/engine...
>
>


--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century
3aaa40ee161275eb192b2895ca7c866b?d=identicon&s=25 Brett Walker (Guest)
on 2007-03-10 04:00
(Received via mailing list)
I've used the converted ActiveRbac  mentioned - its working great for
me.  The conversion itself is not hard or that complicated.

Cheers,
Brett
9c662bd4110d5913f6bf6e828fd26dd9?d=identicon&s=25 Martin Xu (martinx)
on 2007-03-10 04:56
(Received via mailing list)
I checked out codes from
https://activerbac.turingstudio.com/source/,thatwas out of
data.I've seen the rubyforge has releaseed 0.4.1 already.
It works ok with engines 1.2 and rails 1.2.2.Thanks.
This topic is locked and can not be replied to.