# Why not auto import active\_rbac's lib$B!)(B

**URL:** <https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271>\
**Category:** Engines\
**Created:** [March 9, 2007, 10:22am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271 "2007-03-09T10:22:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 9, 2007, 10:22am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/1 "2007-03-09T10:22:27Z")

</div>

I’ve installed the lasted engines and active\_rbac from svnï¼Œand  
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 libã€‚The  
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?

---

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 9, 2007, 10:31am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/2 "2007-03-09T10:31:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 9, 2007, 10:37am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/3 "2007-03-09T10:37:28Z")

</div>

Oh,I see,thanks James.

---

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 9, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/4 "2007-03-09T20:51:03Z")

</div>

Did you try the activerbac code from rubyforge? Supposedly it has  
been updated for 1.2

[http://rubyforge.org/frs/?group\_id=2972](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/](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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > I’ve installed the lasted engines and active\_rbac from svne$B!$e(Band  
> > > 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-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> 
> > 
> 
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> 
> > 
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–  
Greg F.  
The Norcross Group  
Forensics for the 21st Century

---

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 10, 2007, 4:56am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/5 "2007-03-10T04:56:52Z")

</div>

I checked out codes from  
[https://activerbac.turingstudio.com/source/,thatwas](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.

---

<div class="post-metadata">

**Author:** ![martinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@martinx](https://www.ruby-forum.com/u/martinx)\
**Post date:** [March 10, 2007, 4:00am UTC](https://www.ruby-forum.com/t/why-not-auto-import-active-rbacs-lib-b-b/88271/6 "2007-03-10T04:00:48Z")

</div>

I’ve used the converted ActiveRbac mentioned - its working great for  
me. The conversion itself is not hard or that complicated.

Cheers,  
Brett
