Skip to content

Instantly share code, notes, and snippets.

@Peksa
Created December 29, 2011 02:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peksa/1531277 to your computer and use it in GitHub Desktop.
Save Peksa/1531277 to your computer and use it in GitHub Desktop.
Play base controller
@With(BaseController.class)
public class Application extends Controller
{
// Normal controller actions here
}
public class BaseController extends Controller
{
@Before
static void setConnectedUser()
{
if (Security.isConnected())
{
User connectedUser = User.findById(Security.getConnectedUser());
renderArgs.put("connectedUser", connectedUser);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment