27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

This chapter covers<br />

� Working with engine code and generators<br />

Authentication<br />

and basic authorization<br />

� Building an authentication system with an engine<br />

� Implementing basic authorization checking<br />

You’ve now created two resources for your Ticketee application: projects and tickets.<br />

Now you’ll use a gem called Devise, which provides authentication, to let users<br />

sign in to your application. With this feature, you can track which tickets were created<br />

by which users. A little later, you’ll use these user records to allow and deny<br />

access to certain parts of the application.<br />

The general idea behind having users for this application is that some users are<br />

in charge of creating projects (project owners) and others use whatever the projects<br />

provide. If they find something wrong with it or wish to suggest an improvement,<br />

filing a ticket is a great way to inform the project owner of their request. You<br />

don’t want absolutely everybody creating or modifying projects, so you’ll learn to<br />

restrict project creation to a certain subset of users.<br />

117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!