I try to restrict (using deadbolt) something in my view (play! framework
) and I have to pass a parameter like:
#{deadbolt.restrictedResource resourceKeys:['projectEdit'], resourceParameters:['projectId':'3'}
You notice 3
is harcoded for example (it works). But I need it dynamic, like:
#{deadbolt.restrictedResource resourceKeys:['projectEdit'], resourceParameters:['projectId':${project.alias}]}
Well, now the code no longer works but it throws an exception:
Exception raised was MissingMethodException : No signature of method: Template_1012.$() is applicable for argument types: (Template_1012$_run_closure1_closure2) values: [Template_1012$_run_closure1_closure2@370c488c] Possible solutions: _(java.lang.String), is(java.lang.Object), run(), run(), any(), get(java.lang.String).
Do you know why this is happening?
Off the top of my head, try quote it:
#{deadbolt.restrictedResource resourceKeys:['projectEdit'], resourceParameters:['projectId':'${project.alias}']}
Let me know if that works, and we can take it from there if necessary.