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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access