|
|
Re: [CDO] Enable security manager in embedded server [message #1138626 is a reply to message #1133995] |
Tue, 15 October 2013 03:57  |
Eclipse User |
|
|
|
Thanks Eike. That worked albeit with a problem. Had to make a call to SecurityManagerUtil.prepareContainer(). However from the looks of it SecurityManager code internally using IPLuginContainer.INSTANCE as the container. Therefore this works only if the container is IPLuginContainer.INSTANCE. I get factory not found exceptions if I use a custom container(even after calling SecurityManagerUtil.prepareContainer()).
For now I could use IPLuginContainer.INSTANCE for tests cases. However if and when tests run in parallel I will be affected I guess.
Eike Stepper wrote on Sat, 12 October 2013 02:41Am 10.10.2013 08:53, schrieb Ashish Shinde:
> We need to enable security manager for an embedded CDO server (4.2). We are starting the server using code similar to
> http://wiki.eclipse.org/CDO/Embedded.
>
> How do we enable security manager in the code snippet above.
There's an example in org.eclipse.emf.cdo.server.internal.security.SecurityExtension.configureRepository(Element):
String description = securityManagerElement.getAttribute("description");
if (description == null || description.length() == 0)
{
description = securityManagerElement.getAttribute("realmPath");
}
if (description == null || description.length() == 0)
{
description = DEFAULT_REALM_PATH;
}
InternalSecurityManager securityManager = (InternalSecurityManager)container.getElement(
SecurityManagerFactory.PRODUCT_GROUP, "default", description);
securityManager.setRepository(repository);
It's best do do that before the repository gets activated, but I it's also possible thereafter.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.04395 seconds