O'Reilly logo

Grails 2: A Quick-Start Guide by Ben Klein, Dave Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging In

Before we get into creating filters and building our security system, let’s talk about what we want the system to do. First, we want to know who is currently using the system; that is, are they an anonymous user (which is fine), or are they represented by a TekUser instance? Next, we want to restrict access to certain areas of the application based on the current user. For example, only organizers should be able to edit a TekEvent instance, and only organizers or volunteers should be able to participate in the event’s forum.

For the first step, we will need some sort of login process. We will create two new actions in the TekUserController: login and logout. We will also create a new login view.

Open TekDays/grails-app/controllers/com/tekdays/TekUserController.groovy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required