# Restful Authentication

**URL:** <https://www.ruby-forum.com/t/restful-authentication/153502>\
**Category:** Rails\
**Created:** [November 18, 2008, 2:28am UTC](https://www.ruby-forum.com/t/restful-authentication/153502 "2008-11-18T02:28:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3be4f8/32.png) [@jrm](https://www.ruby-forum.com/u/jrm)\
**Post date:** [November 18, 2008, 2:28am UTC](https://www.ruby-forum.com/t/restful-authentication/153502/1 "2008-11-18T02:28:58Z")

</div>

Hi,

I added authentication to an app that already had a Person model.  
Rather than use the Person class to represent “Users” I created a User  
model and stored “users” in a users table. I now want to clean that  
up as my “People” can now also be “Users”.

My initial stab was to just migrate the authentication columns (encr.  
password, salt, login) to the Person model/table and simply get User  
to inherit from Person (I did not bother with using a STI type  
column):

Person \< ActiveRecord::Base  
…  
end

User \< Person  
…  
end

Doing this I can still keep all of my authentication specific stuff in  
the User class - and all my other code just continues to work as  
expected, i.e. it is just an object storage change.

This works as expected, but can anyone see any problems with this  
approach. My initial thought is the attributes that are locked down  
via the user class are now accessible via the Person class.

Thanks is advance…

James
