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
1
vote
1 answer

Jackson deserialiser affected by the Deadbolt "restrict" annotation

I receiving an exception Could not resolve type id 'path.to.MyClass' as a subtype of [simple type, class java.lang.Object]: no such class found on play 2.7 server with DeadBolt (2.6.3 and 2.7.0) when I try deserialise JSON to Map
Stepanov Andrey
  • 129
  • 2
  • 9
1
vote
2 answers

Scala DeadboltAction andThen custom play ActionBuilder

Here my problem: I need to check in a controller the user permission using deadbolt and then add something to the request (using an ActionBuilder). Normally using Play Action Builders would be (action1 andThen action2) but this doesn't work with…
epinal
  • 1,415
  • 1
  • 13
  • 27
1
vote
0 answers

Deadbolt, subjectPresent and @this

So with deadbolt currently, using play framework 2.6.X, it seems that i need to use the @this to import the subjectPresent into my template. I'm sure "import" is the wrong term, but you understand the concept. The problem is that the moment I use…
bharal
  • 15,461
  • 36
  • 117
  • 195
1
vote
1 answer

Play 2.5 application(deadbolt?) becomes unresponsive

I have recently upgraded to play 2.5. Everything works, until the system gets busy generating reports (in separate threads) when I suddenly am unable to access any page in the web application. I don't see any errors in the log. The play 2.3.8…
Chet
  • 96
  • 8
1
vote
1 answer

Play 2.5 Deadbolt-2's @subjectPresentOr migrating from Java -> Scala

I'm migrating an existing Java Play 2.5 application to Scala and found in the view main.scala.html the use of the following deadbolt-2 class subjectPresentOr: @subjectPresentOr() {
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
1
vote
1 answer

How to manipulate response status in deadbolt onAuthFailure

I'm using deadbolt library for authentication in my playframewrok server app which holds api for some other frontend application. In MyDeadboltHandler class in onAuthFailure method when user isn't authenticated I want to return status 403 with next…
stef
  • 165
  • 1
  • 10
1
vote
1 answer

set cookie session deadbolt 2 in controller

I'm new deadbolt 2, code sample have hardcode check in MyDeadboltHandler AuthorisedUser.findByUserName("steve") and I see an other example 'final Http.Cookie userCookie = context.request().cookie("user");' in MyDeadboltHandler but I don't know…
Chung Do
  • 79
  • 9
1
vote
1 answer

Deadbolt2 -> SecureSocial/Silhouette Integration

As anyone managed to integrate Deadbolt2 with Silhouette/SecureSocial ? I find Silhouette Authorization a bit basic and Deadbolt2 meets all the requirements. Thanks
Driver
  • 538
  • 5
  • 12
1
vote
2 answers

How to test controllers using deadbolt2 DeadboltActions or is there another framework which allows this easily?

I'm using Play! 2.4 with Deadbolt2 for authorization. However, since I introduced the authorization rules, I'm unable to write successful tests for my controllers. As an example: class VisitController @Inject() (authorization: DeadboltActions)…
redwulf
  • 1,317
  • 3
  • 13
  • 35
1
vote
1 answer

Play 2.4 and Deadbolt installation

So I'm still getting to grips with Play 2.4 I wanted to use Deadbolt for authentication but it doesn't seem to be resolving any of the deadbolt classes. In my build.sbt, libraryDependencies ++= Seq( javaJdbc, cache, javaWs, "be.objectify" %%…
nbz
  • 3,806
  • 3
  • 28
  • 56
1
vote
1 answer

Deadbolt 2 and Play 2.4.x: Null pointer exception on unaccessible pages

I'm trying to implement a simple autentication system in Play Framework 2.4.x using Deadbolt 2. I've followed this guide written by Chaloner and I've implemented my deadbolt handler as you can see here: public class MyDeadboltHandler extends…
Ema.jar
  • 2,370
  • 1
  • 33
  • 43
1
vote
2 answers

Playframework with Deadbolt 2: Pattern regular expression not match

I am using Deadbolt2 with play-framework 2.3.x. When I am trying to access the controller with declare deadbolt Patterns using regular expressions. I am getting Not-found error. According to this sample, it is possible to use regular expressions…
Harmeet Singh Taara
  • 6,483
  • 20
  • 73
  • 126
1
vote
1 answer

Testing if user is allow with a function (not an annotation)

I want to test permissions of a user in my controller, but I need the name of the permission to change at runtime (sometime it is "projectWrite", sometime "userWrite"...), but annotation need a constant, so I can't use it. I need to use a function,…
Moebius
  • 6,242
  • 7
  • 42
  • 54
1
vote
1 answer

Configuring deadbolt on playframework project

Hello I have got a small problem with configuring deadbolt module at my playframework project. I'm using playframework 2.2.1 version I was doing all step by step like they show at deadbolt documentation page http://deadbolt.ws/#/java-docs The first…
Kox
  • 98
  • 8
0
votes
1 answer

How to get the value of a controller parameter when using dynamic permissions in deadbolt

I am using a dynamic permission in Deadbolt 2 on my controller to check whether a user has access to a resource or not. This resource has an ID and in my controller, I have a method getById(String id) . Looks like that…
Tom
  • 1,357
  • 2
  • 13
  • 32