*/
public static boolean hasAuthority(String role, HttpSession aSession) throws CustomException {
if (SecurityContextHolder.getContext() != null) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
final Collection<? extends GrantedAuthority> authorities = auth.getAuthorities();
final GrantedAuthority authority = new SimpleGrantedAuthority(role);
boolean hasAuthority = authorities.contains(authority);
if (!hasAuthority) {
throw new CustomException(MessageFormat.format(LocaleManager.getInstance(aSession).getMessageResource(ServiceSecurityHelper.class)
.getString("EXCEPTION_ACCESS_DENIED_BECAUSE_OF_RIGHTS"), role));
}