@Test void testGetNameRole() { assertEquals("test", getName(new GrantedAuthoritySid("ROLE_test"))); }
public static String getName(Sid sid) { Optional<String> name = getRolename(sid); if (!name.isPresent()) { name = getUsername(sid); } if (!name.isPresent()) { throw new IllegalStateException( "Sid should always be either a GrantedAuthoritySid or a PrincipalSid"); } return name.get(); }
UserRoleTools { public static String getName(Sid sid) { Optional<String> name = getRolename(sid); if (!name.isPresent()) { name = getUsername(sid); } if (!name.isPresent()) { throw new IllegalStateException( "Sid should always be either a GrantedAuthoritySid or a PrincipalSid"); } return name.get(); } }
UserRoleTools { public static String getName(Sid sid) { Optional<String> name = getRolename(sid); if (!name.isPresent()) { name = getUsername(sid); } if (!name.isPresent()) { throw new IllegalStateException( "Sid should always be either a GrantedAuthoritySid or a PrincipalSid"); } return name.get(); } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); }
UserRoleTools { public static String getName(Sid sid) { Optional<String> name = getRolename(sid); if (!name.isPresent()) { name = getUsername(sid); } if (!name.isPresent()) { throw new IllegalStateException( "Sid should always be either a GrantedAuthoritySid or a PrincipalSid"); } return name.get(); } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); }
UserRoleTools { public static String getName(Sid sid) { Optional<String> name = getRolename(sid); if (!name.isPresent()) { name = getUsername(sid); } if (!name.isPresent()) { throw new IllegalStateException( "Sid should always be either a GrantedAuthoritySid or a PrincipalSid"); } return name.get(); } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); static final String ANONYMOUS; }