Skip to content
Snippets Groups Projects
Commit 640ae10c authored by gnaegi's avatar gnaegi
Browse files

OO-552 implement sec callback to test if access control module is enabled

parent d1bebc51
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
<bean class="org.olat.core.extensions.action.GenericActionExtension" name="groups.open" init-method="initExtensionPoints"> <bean class="org.olat.core.extensions.action.GenericActionExtension" name="groups.open" init-method="initExtensionPoints">
<property name="order" value="8201" /> <property name="order" value="8201" />
<property name="navigationKey" value="OpenGroups" /> <property name="navigationKey" value="OpenGroups" />
<property name="securityCallbackClassName" value="org.olat.resource.accesscontrol.AccessControlModuleEnabledSecurityCallback" />
<property name="actionController"> <property name="actionController">
<bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype"> <bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
<property name="className" value="org.olat.group.ui.main.OpenBusinessGroupsController"/> <property name="className" value="org.olat.group.ui.main.OpenBusinessGroupsController"/>
......
/**
* <a href=“http://www.openolat.org“>
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* 22.02.2013 by frentix GmbH, http://www.frentix.com
* <p>
**/
package org.olat.resource.accesscontrol;
import org.olat.core.CoreSpringFactory;
import org.olat.core.extensions.action.ActionExtensionSecurityCallback;
import org.olat.core.gui.UserRequest;
/**
* @author Florian Gnaegi, frentix GmbH
*
* This callback returns true when the access control module is enabled, false otherwise
*
*/
public class AccessControlModuleEnabledSecurityCallback implements
ActionExtensionSecurityCallback {
private final AccessControlModule acModule = CoreSpringFactory.getImpl(AccessControlModule.class);
/**
* @see org.olat.core.extensions.action.ActionExtensionSecurityCallback#
* isAllowedToLaunchActionController(org.olat.core.gui.UserRequest)
*/
@Override
public boolean isAllowedToLaunchActionController(UserRequest ureq) {
return acModule.isEnabled();
}
}
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