1

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, but I don't know how to ask for the authorisation via function. How to do this ?

Mohit Kanwar
  • 2,962
  • 7
  • 39
  • 59
Moebius
  • 6,242
  • 7
  • 42
  • 54

1 Answers1

1

You need to call be.objectify.deadbolt.core.DeadboltAnalyzer.

Matt
  • 74,352
  • 26
  • 153
  • 180
Steve Chaloner
  • 8,162
  • 1
  • 22
  • 38
  • Hi Steve, is it possible to check a Dynamic restriction in the same way? I couldn't find it on `be.objectify.deadbolt.core.DeadboltAnalyzer` – nipo Sep 02 '15 at 05:37
  • `Dynamic` works purely on what you define in your `DynamicResourceHandler`s - there's no built-in implementation. – Steve Chaloner Sep 02 '15 at 05:56