/**
* Method to enforce security and only allow administrators to modify users. Regular
* users are allowed to modify themselves.
*/
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;
GrantedAuthority[] roles = auth.getauthorities();
for (int i=0; i < roles.length; i++) {
if (roles[i].getauthority().equals(Constants.ADMIN_ROLE)) {
administrator = true;