Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupController.java =================================================================== diff -u -reb835b7d5fabc6550e22baefc313476b8fa1395d -rc709fd20ffec8a4734d0e45c2167c44076b73b6e --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupController.java (.../DisplayGroupController.java) (revision eb835b7d5fabc6550e22baefc313476b8fa1395d) +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupController.java (.../DisplayGroupController.java) (revision c709fd20ffec8a4734d0e45c2167c44076b73b6e) @@ -121,7 +121,7 @@ List moreLinks = new ArrayList<>(); boolean isSpTeamworkEnabled = Configuration.isLamsModuleAvailable(Configuration.TEAMWORK_MODULE_CLASS); - if (isSpTeamworkEnabled) { + if (isSpTeamworkEnabled && (roles.contains(Role.ROLE_MONITOR) || roles.contains(Role.ROLE_GROUP_MANAGER))) { moreLinks.add( new IndexLinkBean("index.teamwork", "javascript:openTeamworkMonitorWindow(" + organisationId + ")", "fa fa-fw fa-handshake-o", null)); Index: lams_central/src/java/org/lamsfoundation/lams/web/IndexController.java =================================================================== diff -u -reb835b7d5fabc6550e22baefc313476b8fa1395d -rc709fd20ffec8a4734d0e45c2167c44076b73b6e --- lams_central/src/java/org/lamsfoundation/lams/web/IndexController.java (.../IndexController.java) (revision eb835b7d5fabc6550e22baefc313476b8fa1395d) +++ lams_central/src/java/org/lamsfoundation/lams/web/IndexController.java (.../IndexController.java) (revision c709fd20ffec8a4734d0e45c2167c44076b73b6e) @@ -58,7 +58,6 @@ import java.util.List; /** - * * @author Fei Yang */ @Controller @@ -81,10 +80,9 @@ if (request.isUserInRole(Role.AUTHOR)) { request.setAttribute("showQbCollectionsLink", true); } + boolean isSpTeamworkEnabled = Configuration.isLamsModuleAvailable(Configuration.TEAMWORK_MODULE_CLASS); - if (isSpTeamworkEnabled) { - request.setAttribute("showTeamworkLink", true); - } + request.setAttribute("showTeamworkLink", isSpTeamworkEnabled && request.isUserInRole(Role.LEARNER)); // check if this is user's first login; some action (like displaying a dialog for disabling tutorials) can be // taken based on that parameter; immediatelly, the value in DB is updated @@ -152,8 +150,8 @@ } // This test also appears in LoginAsAction - Boolean allowDirectAccessIntegrationLearner = Configuration - .getAsBoolean(ConfigurationKeys.ALLOW_DIRECT_ACCESS_FOR_INTEGRATION_LEARNERS); + Boolean allowDirectAccessIntegrationLearner = Configuration.getAsBoolean( + ConfigurationKeys.ALLOW_DIRECT_ACCESS_FOR_INTEGRATION_LEARNERS); if (!allowDirectAccessIntegrationLearner) { boolean isIntegrationUser = integrationService.isIntegrationUser(userDTO.getUserID()); //prevent integration users with mere learner rights from accessing index.do @@ -178,8 +176,8 @@ } } - List favoriteOrganisations = userManagementService - .getFavoriteOrganisationsByUser(userDTO.getUserID()); + List favoriteOrganisations = userManagementService.getFavoriteOrganisationsByUser( + userDTO.getUserID()); request.setAttribute("favoriteOrganisations", favoriteOrganisations); Integer targetOrgId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID, true); request.setAttribute("activeOrgId", targetOrgId == null ? user.getLastVisitedOrganisationId() : targetOrgId); @@ -208,10 +206,11 @@ private void setAdminLinks(HttpServletRequest request) { List adminLinks = new ArrayList<>(); - if (request.isUserInRole(Role.APPADMIN) || request.isUserInRole(Role.SYSADMIN) - || request.isUserInRole(Role.GROUP_MANAGER)) { - adminLinks.add(new IndexLinkBean("index.courseman", "javascript:openOrgManagement(" - + userManagementService.getRootOrganisation().getOrganisationId() + ')')); + if (request.isUserInRole(Role.APPADMIN) || request.isUserInRole(Role.SYSADMIN) || request.isUserInRole( + Role.GROUP_MANAGER)) { + adminLinks.add(new IndexLinkBean("index.courseman", + "javascript:openOrgManagement(" + userManagementService.getRootOrganisation().getOrganisationId() + + ')')); } if (request.isUserInRole(Role.APPADMIN) || request.isUserInRole(Role.SYSADMIN) || userManagementService.isUserGlobalGroupManager()) {