use of org.olat.core.extensions.action.ActionExtensionSecurityCallback in project OpenOLAT by OpenOLAT.
the class AbstractExtension method getActionExtensionSecurityCallback.
/**
* returns the defined securityCallback, if none was defined a default SecurityCallback is returned
*/
public ActionExtensionSecurityCallback getActionExtensionSecurityCallback() {
ActionExtensionSecurityCallback securityCallback = null;
if (secCallbackName != null) {
// try to lazy instantiate the callback Object
Class<?> cclazz;
Exception re = null;
try {
cclazz = Thread.currentThread().getContextClassLoader().loadClass(secCallbackName);
Object o = cclazz.newInstance();
securityCallback = (ActionExtensionSecurityCallback) o;
} catch (ClassNotFoundException e) {
re = e;
} catch (SecurityException e) {
re = e;
} catch (IllegalArgumentException e) {
re = e;
} catch (InstantiationException e) {
re = e;
} catch (IllegalAccessException e) {
re = e;
} finally {
if (re != null) {
throw new AssertException("Could not create ActionExtensionSecurityCallback via reflection. classname: " + secCallbackName, re);
}
}
} else {
// load a default callback
ActionExtensionSecurityCallback aescDefault = new ActionExtensionSecurityCallback() {
@Override
public boolean isAllowedToLaunchActionController(UserRequest ureq) {
return true;
}
};
securityCallback = aescDefault;
}
return securityCallback;
}
use of org.olat.core.extensions.action.ActionExtensionSecurityCallback in project openolat by klemens.
the class AbstractExtension method getActionExtensionSecurityCallback.
/**
* returns the defined securityCallback, if none was defined a default SecurityCallback is returned
*/
public ActionExtensionSecurityCallback getActionExtensionSecurityCallback() {
ActionExtensionSecurityCallback securityCallback = null;
if (secCallbackName != null) {
// try to lazy instantiate the callback Object
Class<?> cclazz;
Exception re = null;
try {
cclazz = Thread.currentThread().getContextClassLoader().loadClass(secCallbackName);
Object o = cclazz.newInstance();
securityCallback = (ActionExtensionSecurityCallback) o;
} catch (ClassNotFoundException e) {
re = e;
} catch (SecurityException e) {
re = e;
} catch (IllegalArgumentException e) {
re = e;
} catch (InstantiationException e) {
re = e;
} catch (IllegalAccessException e) {
re = e;
} finally {
if (re != null) {
throw new AssertException("Could not create ActionExtensionSecurityCallback via reflection. classname: " + secCallbackName, re);
}
}
} else {
// load a default callback
ActionExtensionSecurityCallback aescDefault = new ActionExtensionSecurityCallback() {
@Override
public boolean isAllowedToLaunchActionController(UserRequest ureq) {
return true;
}
};
securityCallback = aescDefault;
}
return securityCallback;
}
Aggregations