debug commit

This commit is contained in:
Hugo Renard 2022-04-22 17:04:55 +02:00
parent 96a2ac44fc
commit 67084d699a
Signed by: hougo
GPG key ID: 3A285FD470209C59

View file

@ -102,8 +102,21 @@ public class UserAdapter extends Adapter<UserModel, UserResource> {
.forEach(r -> rolesSet.add(r));
// Bug when new user.
try {
user.getRoleMappingsStream().filter((r) -> r.getFirstAttribute("scim").equals("true"))
.map((r) -> r.getName()).forEach(r -> rolesSet.add(r));
var roleStream = user.getRoleMappingsStream();
if (rolesSet == null) {
LOGGER.error("role stream is null");
}
roleStream.filter((r) -> {
var attr = r.getFirstAttribute("scim");
if (attr == null) {
LOGGER.debug("attribute is null");
return false;
}
return attr.equals("true");
}).map((r) -> r.getName()).forEach(r -> rolesSet.add(r));
// user.getRoleMappingsStream().filter((r) -> r.getFirstAttribute("scim").equals("true"))
// .map((r) -> r.getName()).forEach(r -> rolesSet.add(r));
} catch (Exception e) {
LOGGER.error(e);
}