
Originally Posted by
ole.ersoy
That rocks! I was up until 3 a.m. playing with reflection and attempting an algorithm to understand how it could work. Thank God we don't need to go down that route!
I'm almost there.
Check this out:
Code:
public boolean isCallable(String jsBeanName, String methodName){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Container ct = ServerContextFactory.get(null).getContainer();
Object obj = ct.getBean(jsBeanName);
MethodInvocation mi = MethodInvocationUtils.create(obj, methodName);
return MethodInvocationPrivilegeEvaluator.isAllowed(mi, authentication);
};
The only thing that is not working is MethodInvocationPrivilegeEvaluator, that it's methods are not static, so i have to get an instance of this object from somewhere (i guess from spring configuration).
Let's finish with this!!!
Regards,