Skip to content

Commit

Permalink
SEBSERV-606 cherry-picked from development branch
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Dec 9, 2024
1 parent 3914f79 commit e212d97
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,16 @@ public void compose(final PageContext pageContext) {

final PageActionBuilder actionBuilder = this.pageService.pageActionBuilder(pageContext);

final boolean isTeacherOnly = this.currentUser.get().hasAnyRole(UserRole.TEACHER) &&
!this.currentUser.get().hasAnyRole(UserRole.EXAM_SUPPORTER) &&
!this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN) ;
final boolean isTeacherOnly = this.currentUser.get().hasRole(UserRole.TEACHER) &&
this.currentUser.get().roles.size() == 1 ;

//--------------------------------------------------------------------------------------
// ---- SEB ADMIN ----------------------------------------------------------------------

final boolean isServerOrInstAdmin = this.currentUser.get()
.hasAnyRole(UserRole.SEB_SERVER_ADMIN, UserRole.INSTITUTIONAL_ADMIN);

if (isServerOrInstAdmin) {
if (!isTeacherOnly) {
// SEB Server Administration
final TreeItem sebAdmin = this.widgetFactory.treeItemLocalized(
navigation,
Expand Down Expand Up @@ -140,7 +139,7 @@ public void compose(final PageContext pageContext) {

// User Account
// if current user has role seb-server admin or institutional-admin, show list
if (!pageService.isLightSetup() && currentUser.isFeatureEnabled(UserFeatures.Feature.ADMIN_USER_ADMINISTRATION)) {
if (!pageService.isLightSetup() && isServerOrInstAdmin && currentUser.isFeatureEnabled(UserFeatures.Feature.ADMIN_USER_ADMINISTRATION)) {

final TreeItem userAccounts = this.widgetFactory.treeItemLocalized(
sebAdmin,
Expand Down

0 comments on commit e212d97

Please sign in to comment.