security - Check user profile in view in PlayFramework? -


in play application, i've added secure module. haven't found way check user profile in views. example, 1 of possible roles "admin". when viewing pages, button should visible admin's only. how that?

my first idea check session variable found nothing there. security object not available in views. thought putting data in there overriding onauthenticated method in authentification controller, i'm not sure best way proceed.

what think?

if have own security module extends controller.secure.security, within view can this:

#{if controllers.mysecurity.check("isadmin") }    ...template code... #{/if} 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -