Skip to content

Commit

Permalink
#3957 - Cannot create project using project-creator role
Browse files Browse the repository at this point in the history
- Show menubar also to project creators - this is in particular important during the creation of projects using the traditional "New project" approach
- Fix typo
  • Loading branch information
reckart committed Apr 18, 2023
1 parent 2f3b292 commit c1fa195
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void execute()

appEventPublisher.publishEvent(
RecommenderTaskNotificationEvent.builder(this, project, user.getUsername()) //
.withMessage(LogMessage.info(this, "New preditions available")) //
.withMessage(LogMessage.info(this, "New predictions available")) //
.build());

// We reset this in case the state was not properly cleared, e.g. the AL session
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,18 @@ private boolean isMenubarVisibleToCurrentUser()
return true;
}

if (userRepository.isAdministrator(user.getObject())) {
if (userRepository.isAdministrator(user.getObject())
|| userRepository.isProjectCreator(user.getObject())) {
return true;
}

// The project might be null if it is in the process of being created. Normally, this can
// only be done by admisn and project creators that are handled above - so returning false
// here is really just a sanity fallback that should never kick in.
if (project.getObject().getId() == null) {
return false;
}

var roles = dashboardProperties.getAccessibleByRoles().toArray(PermissionLevel[]::new);
return projectService.hasRole(user.getObject(), project.getObject(), MANAGER, roles);
}
Expand Down

0 comments on commit c1fa195

Please sign in to comment.