Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Joseph Hall
Joseph Hall
10,865 Points

Multi tiered longin/register system in rails

I am building an application in Ruby on Rails that has a 2 different pricing models. How do I create a login system for each pricing structure for devise?

The one similar to the gold and silver memberships at treehouse. Does the treehouse staff have any thought on this?

Joseph

Devise is an authentication system. It is only to tell you if this person is who they say they are.

What you are trying to do is treat authenticated people differently, this is often solved by having different roles - so you would have gold role and a silver role and changing the html generating views as appropriate .

When you come up with your different roles you need to make sure that people can't cheat so you need an authorization/permissions system in your web application.

A popular authorization system is CanCan which was written by Rails rails-dude-miester Ryan Bates - he also does a authorization from scratch video which is a must watch to remove the magic from authorization. It's important to have a clear understanding about authentication vs authorization or it's going to bite you hard.

This is a good stack overflow question and answer to get you going

Good luck Joseph * salutes *

Rich

1 Answer

Joseph Hall
Joseph Hall
10,865 Points

Hi Rich!

Yes the railscasts guy is very trustworthy. I will check it out!

Joseph salutes back