* @param args the arguments to the method
* @param target the target class
* @throws Throwable thrown when args[0] is null or not a User object
*/
public void before(Method method, Object[] args, Object target) throws Throwable {
SecurityContext ctx = SecurityContextHolder.getContext();
if (ctx.getAuthentication() != null) {
Authentication auth = ctx.getAuthentication();
boolean administrator = false;
Collection<? extends GrantedAuthority> roles = auth.getAuthorities();
for (GrantedAuthority role : roles) {
if (role.getAuthority().equals(Constants.ADMIN_ROLE)) {
administrator = true;