Skip to content
Snippets Groups Projects
Commit b1d5c4b0 authored by srosse's avatar srosse
Browse files

OO-1610: don't show the access control panel if the module is disabled

parent 8812bce4
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,6 @@ import org.olat.course.assessment.AssessmentChangedEvent; ...@@ -89,7 +89,6 @@ import org.olat.course.assessment.AssessmentChangedEvent;
import org.olat.course.assessment.AssessmentMainController; import org.olat.course.assessment.AssessmentMainController;
import org.olat.course.assessment.AssessmentModule; import org.olat.course.assessment.AssessmentModule;
import org.olat.course.assessment.CoachingGroupAccessAssessmentCallback; import org.olat.course.assessment.CoachingGroupAccessAssessmentCallback;
import org.olat.course.assessment.EfficiencyStatementManager;
import org.olat.course.assessment.FullAccessAssessmentCallback; import org.olat.course.assessment.FullAccessAssessmentCallback;
import org.olat.course.assessment.ui.AssessmentModeListController; import org.olat.course.assessment.ui.AssessmentModeListController;
import org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController; import org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController;
...@@ -191,8 +190,6 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im ...@@ -191,8 +190,6 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im
private BusinessGroupService businessGroupService; private BusinessGroupService businessGroupService;
@Autowired @Autowired
private AssessmentModule assessmentModule; private AssessmentModule assessmentModule;
@Autowired
private EfficiencyStatementManager efficiencyStatementManager;
public CourseRuntimeController(UserRequest ureq, WindowControl wControl, public CourseRuntimeController(UserRequest ureq, WindowControl wControl,
RepositoryEntry re, RepositoryEntrySecurity reSecurity, RuntimeControllerCreator runtimeControllerCreator, RepositoryEntry re, RepositoryEntrySecurity reSecurity, RuntimeControllerCreator runtimeControllerCreator,
......
...@@ -61,7 +61,6 @@ import org.olat.core.util.resource.OresHelper; ...@@ -61,7 +61,6 @@ import org.olat.core.util.resource.OresHelper;
import org.olat.course.CourseModule; import org.olat.course.CourseModule;
import org.olat.course.assessment.AssessmentMode; import org.olat.course.assessment.AssessmentMode;
import org.olat.course.assessment.AssessmentModeManager; import org.olat.course.assessment.AssessmentModeManager;
import org.olat.course.assessment.AssessmentModule;
import org.olat.course.assessment.model.TransientAssessmentMode; import org.olat.course.assessment.model.TransientAssessmentMode;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntryManagedFlag; import org.olat.repository.RepositoryEntryManagedFlag;
...@@ -153,8 +152,6 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController ...@@ -153,8 +152,6 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController
@Autowired @Autowired
protected MarkManager markManager; protected MarkManager markManager;
@Autowired @Autowired
private AssessmentModule assessmentModule;
@Autowired
protected RepositoryModule repositoryModule; protected RepositoryModule repositoryModule;
@Autowired @Autowired
private RepositoryService repositoryService; private RepositoryService repositoryService;
......
...@@ -36,6 +36,7 @@ import org.olat.repository.RepositoryManager; ...@@ -36,6 +36,7 @@ import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryService; import org.olat.repository.RepositoryService;
import org.olat.repository.controllers.EntryChangedEvent; import org.olat.repository.controllers.EntryChangedEvent;
import org.olat.repository.controllers.EntryChangedEvent.Change; import org.olat.repository.controllers.EntryChangedEvent.Change;
import org.olat.resource.accesscontrol.AccessControlModule;
import org.olat.resource.accesscontrol.ui.AccessConfigurationController; import org.olat.resource.accesscontrol.ui.AccessConfigurationController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -57,6 +58,8 @@ public class AuthoringEditAccessController extends BasicController { ...@@ -57,6 +58,8 @@ public class AuthoringEditAccessController extends BasicController {
private RepositoryEntry entry; private RepositoryEntry entry;
@Autowired @Autowired
private AccessControlModule acModule;
@Autowired
private RepositoryManager repositoryManager; private RepositoryManager repositoryManager;
public AuthoringEditAccessController(UserRequest ureq, WindowControl wControl, RepositoryEntry entry) { public AuthoringEditAccessController(UserRequest ureq, WindowControl wControl, RepositoryEntry entry) {
...@@ -76,10 +79,11 @@ public class AuthoringEditAccessController extends BasicController { ...@@ -76,10 +79,11 @@ public class AuthoringEditAccessController extends BasicController {
boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings); boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings);
acCtr = new AccessConfigurationController(ureq, getWindowControl(), entry.getOlatResource(), entry.getDisplayname(), true, !managedBookings); acCtr = new AccessConfigurationController(ureq, getWindowControl(), entry.getOlatResource(), entry.getDisplayname(), true, !managedBookings);
listenTo(acCtr);
int access = propPupForm.getAccess(); int access = propPupForm.getAccess();
int numOfBookingConfigs = acCtr.getNumOfBookingConfigurations(); int numOfBookingConfigs = acCtr.getNumOfBookingConfigurations();
if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) { if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) {
if(!managedBookings || numOfBookingConfigs > 0) { if((!managedBookings && acModule.isEnabled()) || numOfBookingConfigs > 0) {
editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent()); editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent());
editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS)); editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS));
} }
...@@ -118,7 +122,7 @@ public class AuthoringEditAccessController extends BasicController { ...@@ -118,7 +122,7 @@ public class AuthoringEditAccessController extends BasicController {
boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings); boolean managedBookings = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.bookings);
if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) { if(access == RepositoryEntry.ACC_USERS || access == RepositoryEntry.ACC_USERS_GUESTS) {
if(!managedBookings || numOfBookingConfigs > 0) { if((!managedBookings && acModule.isEnabled()) || numOfBookingConfigs > 0) {
editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent()); editproptabpubVC.put("accesscontrol", acCtr.getInitialComponent());
editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS)); editproptabpubVC.contextPut("isGuestAccess", Boolean.valueOf(access == RepositoryEntry.ACC_USERS_GUESTS));
} }
...@@ -140,6 +144,10 @@ public class AuthoringEditAccessController extends BasicController { ...@@ -140,6 +144,10 @@ public class AuthoringEditAccessController extends BasicController {
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, entry); CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, entry);
fireEvent(ureq, Event.CHANGED_EVENT); fireEvent(ureq, Event.CHANGED_EVENT);
} }
} else if(acCtr == source) {
if(event == Event.CHANGED_EVENT) {
fireEvent(ureq, Event.CHANGED_EVENT);
}
} }
} }
} }
...@@ -32,7 +32,6 @@ import org.olat.core.util.Util; ...@@ -32,7 +32,6 @@ import org.olat.core.util.Util;
import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryManager; import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryService; import org.olat.repository.RepositoryService;
import org.olat.resource.OLATResourceManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/** /**
...@@ -48,12 +47,8 @@ public class CopyRepositoryEntryController extends FormBasicController { ...@@ -48,12 +47,8 @@ public class CopyRepositoryEntryController extends FormBasicController {
private RepositoryEntry copyEntry; private RepositoryEntry copyEntry;
private final RepositoryEntry sourceEntry; private final RepositoryEntry sourceEntry;
@Autowired
private RepositoryManager repositoryManager;
@Autowired @Autowired
private RepositoryService repositoryService; private RepositoryService repositoryService;
@Autowired
private OLATResourceManager resourceManager;
public CopyRepositoryEntryController(UserRequest ureq, WindowControl wControl, RepositoryEntry sourceEntry) { public CopyRepositoryEntryController(UserRequest ureq, WindowControl wControl, RepositoryEntry sourceEntry) {
super(ureq, wControl); super(ureq, wControl);
......
...@@ -42,11 +42,8 @@ import org.olat.core.logging.activity.ThreadLocalUserActivityLogger; ...@@ -42,11 +42,8 @@ import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.Util; import org.olat.core.util.Util;
import org.olat.core.util.resource.OresHelper; import org.olat.core.util.resource.OresHelper;
import org.olat.repository.RepositoryManager; import org.olat.repository.RepositoryManager;
import org.olat.repository.handlers.RepositoryHandlerFactory;
import org.olat.repository.model.SearchAuthorRepositoryEntryViewParams; import org.olat.repository.model.SearchAuthorRepositoryEntryViewParams;
import org.olat.user.UserManager;
import org.olat.util.logging.activity.LoggingResourceable; import org.olat.util.logging.activity.LoggingResourceable;
import org.springframework.beans.factory.annotation.Autowired;
/** /**
* *
...@@ -65,11 +62,6 @@ public class OverviewAuthoringController extends BasicController implements Acti ...@@ -65,11 +62,6 @@ public class OverviewAuthoringController extends BasicController implements Acti
private boolean isGuestonly; private boolean isGuestonly;
@Autowired
private UserManager userManager;
@Autowired
private RepositoryHandlerFactory repositoryHandlerFactory;
public OverviewAuthoringController(UserRequest ureq, WindowControl wControl) { public OverviewAuthoringController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl); super(ureq, wControl);
setTranslator(Util.createPackageTranslator(RepositoryManager.class, getLocale(), getTranslator())); setTranslator(Util.createPackageTranslator(RepositoryManager.class, getLocale(), getTranslator()));
......
...@@ -53,7 +53,6 @@ import org.olat.core.gui.control.WindowControl; ...@@ -53,7 +53,6 @@ import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.FileUtils; import org.olat.core.util.FileUtils;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.WebappHelper; import org.olat.core.util.WebappHelper;
import org.olat.core.util.i18n.I18nManager;
import org.olat.core.util.vfs.LocalFileImpl; import org.olat.core.util.vfs.LocalFileImpl;
import org.olat.core.util.vfs.LocalFolderImpl; import org.olat.core.util.vfs.LocalFolderImpl;
import org.olat.core.util.vfs.VFSContainer; import org.olat.core.util.vfs.VFSContainer;
...@@ -106,8 +105,6 @@ public class RepositoryEditDescriptionController extends FormBasicController { ...@@ -106,8 +105,6 @@ public class RepositoryEditDescriptionController extends FormBasicController {
private static final String[] dateKeys = new String[]{ "none", "private", "public"}; private static final String[] dateKeys = new String[]{ "none", "private", "public"};
@Autowired
private I18nManager i18nmanager;
@Autowired @Autowired
private UserManager userManager; private UserManager userManager;
@Autowired @Autowired
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment