# New RBAC Plug-In for Rails

**URL:** <https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624>\
**Category:** Rails\
**Created:** [April 24, 2006, 7:50am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624 "2006-04-24T07:50:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 24, 2006, 7:50am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/1 "2006-04-24T07:50:29Z")

</div>

Hi,

I just finished writing this plug-in. I’ve been using rails for awhile  
but this is my first time extracting some code and writing it as a  
plug-in and I’d love to hear to some feedback. Thanks.

[http://mitchellhashimoto.com/rails/role-based-access-control-plug-in-for-rails/](http://mitchellhashimoto.com/rails/role-based-access-control-plug-in-for-rails/)

-Mitchell

---

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 24, 2006, 8:38am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/2 "2006-04-24T08:38:34Z")

</div>

Hi Mitchell,

What’s the pros and cons of your RBAC plugin vs. the others that are  
already out there?

Regards

Dave M.

---

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 24, 2006, 8:50am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/3 "2006-04-24T08:50:50Z")

</div>

Hey Dave, I have the same question that you do in regards to the  
plugin because I have just started to use ActiveRBAC plugin. At this  
time, I cannot use the supplied SQL file.

-Conrad

---

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 24, 2006, 10:01am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/4 "2006-04-24T10:01:45Z")

</div>

I have tried to install it, put the plugin into vendor/plugins directory  
but it fails when running generators:

C:\ruby\_projects\radrails\workspace\auth2\>ruby script\generate  
protected\_migration  
Couldn’t find ‘protected\_migration’ generator

I use it on WinXP, Rails 1.1.2 .

David

Mitchell H. wrote:

> Hi,
> 
> I just finished writing this plug-in. I’ve been using rails for awhile  
> but this is my first time extracting some code and writing it as a  
> plug-in and I’d love to hear to some feedback. Thanks.
> 
> [http://mitchellhashimoto.com/rails/role-based-access-control-plug-in-for-rails/](http://mitchellhashimoto.com/rails/role-based-access-control-plug-in-for-rails/)
> 
> -Mitchell

---

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 25, 2006, 3:18am UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/5 "2006-04-25T03:18:20Z")

</div>

Cool thanks. I’ll check it out when I kick off my next project - I’m  
already tied to my own custom solution for the current one.

I’m really glad you (and others) are creating new options for  
authorisation. There’s enough different use cases that having a wide  
choice is a good thing.

Regards

Dave M.

---

<div class="post-metadata">

**Author:** ![mitchellh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mitchellh](https://www.ruby-forum.com/u/mitchellh)\
**Post date:** [April 24, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/new-rbac-plug-in-for-rails/58624/6 "2006-04-24T16:14:08Z")

</div>

Hi David,

Sorry the README wasn’t updated completely with the generators. I  
renamed them to rbac\_\* later in development. I updated the readme now  
but all generators instead of being prefixed with protect\_\* are now  
prefixed with rbac\_\*

Mitch

David M. wrote:

> I have tried to install it, put the plugin into vendor/plugins directory  
> but it fails when running generators:
> 
> C:\ruby\_projects\radrails\workspace\auth2\>ruby script\generate  
> protected\_migration  
> Couldn’t find ‘protected\_migration’ generator
> 
> I use it on WinXP, Rails 1.1.2 .
> 
> David

And to David M.:

My blog post explains the pros against acts\_as\_authenticated and  
acl\_system. I have not used ActiveRBAC very much but have glanced over  
it and my plug-in, while keeping the flexibility of ActiveRBAC, allows  
you to use protection straight out of the box. You can also write your  
own authentication methods and customize the user model, but it is not  
necessary. Those are the only solutions I am aware of…

Really it’s my first plug-in and I’d just like feedback, I’m not trying  
to sell a product. If you wish to use it, you can and I very much  
welcome that! But if not, it’s okay as this was a learning experience.

Mitch
