Horje
get role assigned to a user inside spring controller Code Example
get role assigned to a user inside spring controller
private boolean hasRole(String role) {
  Collection<GrantedAuthority> authorities = (Collection<GrantedAuthority>)
  SecurityContextHolder.getContext().getAuthentication().getAuthorities();
  boolean hasRole = false;
  for (GrantedAuthority authority : authorities) {
     hasRole = authority.getAuthority().equals(role);
     if (hasRole) {
      break;
     }
  }
  return hasRole;
}  




Whatever

Related
Fix Vertical Position Issue of Custom iOS Fonts Code Example Fix Vertical Position Issue of Custom iOS Fonts Code Example
factory design pattern Code Example factory design pattern Code Example
can we navigate back and forth in selenium Code Example can we navigate back and forth in selenium Code Example
remove product zoom on woo commerce Code Example remove product zoom on woo commerce Code Example
order status automatically changes from “On hold” to “processing” Code Example order status automatically changes from “On hold” to “processing” Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7