Hi Yamamoto - sorry I dont know Japanese but just trying to reach you and posting here on your blog ... thanks for the acegi plugin, I just wanted to suggest a new feature... if I just put in the code here you'll understand what I mean...
This allows me to access multiple levels of fields using your tag: ${loggedInUserInfo(field:'office.name.bytes.length')}
2 Comments:
Hi Yamamoto - sorry I dont know Japanese but just trying to reach you and posting here on your blog ... thanks for the acegi plugin, I just wanted to suggest a new feature... if I just put in the code here you'll understand what I mean...
This allows me to access multiple levels of fields using your tag: ${loggedInUserInfo(field:'office.name.bytes.length')}
def loggedInUserInfo = {attrs,body->
def authPrincipal = SCH?.context?.authentication?.principal
// customization to take sub-level fields
def fields = attrs.field.split("\\.")
def value
if( authPrincipal!=null && authPrincipal!="anonymousUser"){
value = authPrincipal?.domainClass
fields.length.times {
value = value?."${fields[it]}"
}
out << value
}else{
out << body()
}
}
Sanjay
msanjay75@gmail.com
Nice!
Maybe I'll replace my taglib code!
Post a Comment
<< Home