Skip to content

Commit

Permalink
Merge pull request #4053 from inception-project/bugfix/4052-Admins-no…
Browse files Browse the repository at this point in the history
…-longer-see-all-projects-in-the-project-overview

#4052 - Admins no longer see all projects in the project overview
  • Loading branch information
reckart authored Jun 6, 2023
2 parents 3b163ea + e94e307 commit cc337d9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,11 @@ private static String formatDate(Date aTime)

private List<ProjectEntry> loadProjects()
{
var isAdmin = userRepository.isAdministrator(currentUser.getObject());
return projectService.listAccessibleProjectsWithPermissions(currentUser.getObject())
.entrySet().stream() //
.map(e -> new ProjectEntry(e.getKey(), e.getValue())) //
.filter(e -> e.getLevels().contains(MANAGER)
.filter(e -> isAdmin || e.getLevels().contains(MANAGER)
|| containsAny(e.getLevels(), dashboardProperties.getAccessibleByRoles()))
.sorted(comparing(ProjectEntry::getName)) //
.collect(toList());
Expand Down

0 comments on commit cc337d9

Please sign in to comment.