Skip to content

Commit

Permalink
Set debug level logging for Service impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcolon021 committed Sep 5, 2024
1 parent 4875e38 commit b5c6c65
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class RoleService {
private final RoleRepository roleRepository;
private final PrivilegeService privilegeService;
private final FenceMappingUtility fenceMappingUtility;
public static final String managed_open_access_role_name = "MANAGED_ROLE_OPEN_ACCESS";
public static final String managed_open_access_role_name = "MANUAL_ROLE_OPEN_ACCESS";
public static final String managed_role_named_dataset = "MANUAL_ROLE_NAMED_DATASET";
private final Set<Role> publicAccessRoles = new HashSet<>();

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.stream.Collectors;

import static edu.harvard.hms.dbmi.avillach.auth.service.impl.RoleService.managed_open_access_role_name;
import static edu.harvard.hms.dbmi.avillach.auth.service.impl.RoleService.managed_role_named_dataset;

@Service
public class UserService {
Expand Down Expand Up @@ -673,14 +674,18 @@ public User updateUserRoles(User current_user, Set<String> roleNames) {
current_user.getRoles().addAll(newRoles);
}

final String idp = extractIdp(current_user);
if (!current_user.getRoles().isEmpty() || openAccessIdpValues.contains(idp.toLowerCase())) {
Role openAccessRole = roleService.findByName(managed_open_access_role_name);
if (openAccessRole != null) {
current_user.getRoles().add(openAccessRole);
} else {
logger.warn("Unable to find fence OPEN ACCESS role");
}
Role openAccessRole = roleService.findByName(managed_open_access_role_name);
if (openAccessRole != null) {
current_user.getRoles().add(openAccessRole);
} else {
logger.warn("Unable to find fence OPEN ACCESS role");
}

Role role = roleService.findByName(managed_role_named_dataset);
if (role != null) {
current_user.getRoles().add(role);
} else {
logger.warn("upsertRole() Unable to find role named {}", managed_role_named_dataset);
}

// Every user has access to public datasets by default.
Expand Down

0 comments on commit b5c6c65

Please sign in to comment.