Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not found: value restrict #112

Open
giancarlobastos opened this issue Feb 26, 2021 · 6 comments
Open

not found: value restrict #112

giancarlobastos opened this issue Feb 26, 2021 · 6 comments

Comments

@giancarlobastos
Copy link

I'm testing template constraints as shown in the documentation, but when I try to compile, I get the error:

not found: value restrict
not found: value roles

I'm using:

playVersion = "2.6.23"
scalaVersion = "2.12"
be.objectify:deadbolt-java_2.12:2.6.2

template code:

@import be.objectify.deadbolt.java.views.html.di.{restrict, restrictOr}
@import be.objectify.deadbolt.java.utils.TemplateUtils.{allOf, anyOf}

@restrict(roles = anyOf(allOf("foo", "bar"))) {
    Subject requires the foo role for this to be visible
}
@lucassklp
Copy link

I am facing same issue, there's a thread but I still couldn't do the migration
mkurz/deadbolt-2-scala#38

@lucassklp
Copy link

I solved this by adding this dependency:
"be.objectify" %% "deadbolt-java-gs" % "2.6.0"

check here https://deadbolt-java.readme.io/docs/template-constraints

@lucassklp
Copy link

In fact, using be.objectify" %% "deadbolt-java-gs" % "2.6.0 not worked for me. It compiled but I got a runtime exception. If I get any news, I update this thread

@luish192
Copy link

luish192 commented Mar 8, 2023

Hi, do you get any news? I have the same error

@lucassklp
Copy link

@luish192 unfortunately I gave up to try the migration. I was unable to fix it.

@mkurz
Copy link
Owner

mkurz commented Nov 27, 2023

The solution is in this comment: mkurz/deadbolt-2-scala#38 (comment)
You need to inject the components you need with @this(...) in your template.

I know docs are not up to date yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants