Questions tagged [deadbolt-2]

Deadbolt 2 is an authorization system for the Play framework, with both Scala and Java APIs.

Deadbolt 2 is an authorization system for the Play framework, offering idiomatic APIs for Java and Scala. It allows controller- and view-level constraints through

  • Role-based constraints
  • Regular expression-based constraints
  • Arbitrary user-defined constraints
44 questions
0
votes
1 answer

Getting error when Deadbolt is enabled

I am trying to use Deadbolt in my Play+Scala application (2.5x). I added following into my build.sbt (Play 2.5x): libraryDependencies += "be.objectify" %% "deadbolt-scala" % "2.5.1" And in my conf/application.conf: enabled +=…
NKM
  • 602
  • 1
  • 6
  • 18
0
votes
1 answer

Deadbolt authorization based on parameters

I am testing Deadbolt in a Scala Play Application. My controller methods look something like this: def getProject(projectId: Int) = actionBuilder.RestrictAction("user").defaultHandler() { authRequest => //retrieves project } In this case,…
nmat
  • 7,430
  • 6
  • 30
  • 43
0
votes
1 answer

Play 2.5.x how to modify the content headers of the response i.e. for no cache?

Using Scala and Play 2.5.10 I implemented the following reusable action for composition and with the aim of disabling caching in the browser by changing the response headers: import play.api.http.HeaderNames import play.api.mvc._ import…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
1 answer

Scala Play 2.5 Action composition with Deadbolt-2 actions

I'm working on a Scala Play application and need many Controller actions disabling caching of the browser by setting parameters in the HTTP headers of the Response. I decided to create a NoCache composite action and since I am also using Deadbolt-2…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
1 answer

Deadbolt 2.5 - Error while importing SBT project

Sorry in advance for my bad english.. Today I wanted to implement Deadbolt in my project. I read the documentation in this webstite, but at the begining I had problems. At the first instruction it says that I need to add these lines in my built.sbt…
D.Frances
  • 71
  • 2
  • 7
0
votes
1 answer

Play-Slick: Is it possible to improve this design (pattern) ... and how to call it?

I'm using Play-Slick versions 2.5.x and 3.1.x respectively. I use Slick's code generator and produce the Slick model from an existing database. Actually I'm shy to admit that I'm DB-design driven and not class-design driven. This is the initial…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
1 answer

Play 2.5 type mismatch Session type

Using deadbolt2 I have the following controller function implementation: def restricted: Action = deadbolt.Restrict(List(Array(USER_ROLE)))() { request => Future { val localUser = userProvider.getUser(request.session) // <<< expects a…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
2 answers

Create database play java evolutions

I am using play java 2.5. I have created a database with following java code. public OnStartup() throws SQLException { //demo create database with java code Connection con =…
0
votes
1 answer

Assign Roles to Users during Registration - Play-authenticate with deadbolt

I have created 2 custom roles for my project. I want to assign a Role to the users during the registration process. How can I assign a role by default to the user during the registration. Also, how can I create 2 registration forms, if I have 2…
B. Hadji
  • 1
  • 1
  • 2
0
votes
0 answers

Deadbolt Java integration issue: NullPointerException in AbstractDeadboltAction.call

I am trying to integrate Deadbolt into my application. I have faced the issue and don't know what to do with it. When I go to the restricted page annotated with: @Restrict(@Group("admin")) the program throws following…
Vitalii Oleksiv
  • 1,155
  • 2
  • 9
  • 11
0
votes
1 answer

Playframework with Deadbolt2: overriding method getSubject in trait DeadboltHandler of type

I am using Deadbolt2 for authorization. When i, extends DeadboltHandler and override their methods, i am getting following error in eclipse: implements be.objectify.deadbolt.scala.DeadboltHandler.getSubject overriding method getSubject in trait…
Harmeet Singh Taara
  • 6,483
  • 20
  • 73
  • 126
0
votes
1 answer

Play java project with Deadbolt, having private Assets

I've been looking around to try and find an example of how to configure a folder of assets, have it being accessed through the @routes.Assets notation but only returning the asset if a user is authenticated. I've got deadbolt configured and working…
SysHex
  • 1,750
  • 2
  • 17
  • 27
0
votes
1 answer

Redirecting to different action upon failed restriction in deadbolt2

With deadbolt2 and play-authenticate I can define restrictions on the controller and action level based on a user's roles and permissions. If the current user does not satisfy these restrictions, AbstractDeadboltHandler.onAuthFailure in the…
knittl
  • 246,190
  • 53
  • 318
  • 364
-2
votes
2 answers

How to use AND operator in regex for java to match 2 whole words ? i want both the words to be present

I have 2 separate strings "TM_TASK" and "TM_CHECKLIST". How can i validate both the words in whole using regex in java ? How to use AND operator in regex for this case in java ? i need both the strings to be validated and not either of them. I am…
Sourav Bebarta
  • 51
  • 2
  • 10
1 2
3