# Authentication

**URL:** <https://discuss.rubyonrails.org/t/authentication/2929>\
**Category:** rubyonrails-talk\
**Created:** [October 11, 2006, 10:33am UTC](https://discuss.rubyonrails.org/t/authentication/2929 "2006-10-11T10:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duplex](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Duplex](https://discuss.rubyonrails.org/u/Duplex)\
**Post date:** [October 11, 2006, 10:33am UTC](https://discuss.rubyonrails.org/t/authentication/2929/1 "2006-10-11T10:33:05Z")

</div>

Well the basic behind it is to add a before\_filter to the controllers you want authentication for. You can also include only or exclude specific actions

class ApplicationController ...

before\_filter :authenticated, :except [:list,:show] OR before\_filter :authenticated :only [:create,:edit,:delete]

... your normal actions ...

private def authenticated ...check user permissions... ...return true or false ... end

end

---

<div class="post-metadata">

**Author:** ![Duplex](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Duplex](https://discuss.rubyonrails.org/u/Duplex)\
**Post date:** [October 11, 2006, 10:39am UTC](https://discuss.rubyonrails.org/t/authentication/2929/2 "2006-10-11T10:39:40Z")

</div>

wow ... i should read the preview more careful next time...

1) forgot a colon in the 2nd before\_filter 2) it's "Login Engine" 3) it's "active\_rbac"
