Getting Started with Deadbolt for Java

To use Deadbolt in your Play project, you will need to import the following library in build.sbt.

libraryDependencies ++= Seq(
  "be.objectify" %% "deadbolt-java" % "2.6.1"
)

If you're already running your app in activator, don't forgot to reload the project.

Once this is done, you can enable the Deadbolt module in conf/application.conf.

play {
  modules {
    enabled += be.objectify.deadbolt.java.DeadboltModule
  }
}

A note on migration

If you're migrating to Deadbolt 2.6 and suddenly find all the template restrictions you were using no exist, please read Template constraints. Template restrictions that rely on global state have been moved to a companion library.