Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-12-08 07:51:28 +0000
committerEsteban Dugueperoux2015-12-08 07:51:28 +0000
commit2cb93d4c776f1181eb51457c9dd7e71da531d448 (patch)
tree8d40dcac502e521d97574eb530eb4585c67351ce
parent3f66f78763e5ad34543b66c40a26fa1500109bff (diff)
downloadcdo-2cb93d4c776f1181eb51457c9dd7e71da531d448.tar.gz
cdo-2cb93d4c776f1181eb51457c9dd7e71da531d448.tar.xz
cdo-2cb93d4c776f1181eb51457c9dd7e71da531d448.zip
[483831] [Security] Ease permission use
To avoid deployed metamodel plugins requirement, use the generated package emulation option in SecurityManager. Change-Id: I01300a7afda2268c10b59d51b2c9d59aa2a39d76 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483831 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/.settings/.api_filters6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java84
3 files changed, 92 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java
index e6571c0532..4ccb325c6a 100644
--- a/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java
@@ -560,6 +560,7 @@ public class SecurityManager extends Lifecycle implements InternalSecurityManage
config.setUserID(SYSTEM_USER_ID);
systemSession = config.openNet4jSession();
+ systemSession.options().setGeneratedPackageEmulationEnabled(true);
systemSession.addListener(systemListener);
CDOTransaction initialTransaction = systemSession.openTransaction();
@@ -987,7 +988,9 @@ public class SecurityManager extends Lifecycle implements InternalSecurityManage
{
public CDOView createView(CDORevisionProvider revisionProvider)
{
- return CDOServerUtil.openView(session, securityContext, revisionProvider);
+ CDOView view = CDOServerUtil.openView(session, securityContext, revisionProvider);
+ view.getSession().options().setGeneratedPackageEmulationEnabled(true);
+ return view;
}
});
diff --git a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
index a1ab5b9aed..8c7c4e442c 100644
--- a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
@@ -103,6 +103,12 @@
<message_argument value="ServerCDOSession"/>
</message_arguments>
</filter>
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="ServerCDOSession"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="src/org/eclipse/emf/cdo/internal/server/Session.java" type="org.eclipse.emf.cdo.internal.server.Session">
<filter id="574660632">
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
index c7f8fbfc00..ef3bfd6faa 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
@@ -31,6 +31,7 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
import org.eclipse.emf.cdo.common.security.CDOPermission;
import org.eclipse.emf.cdo.server.IStoreAccessor;
+import org.eclipse.emf.cdo.session.CDOCollectionLoadingPolicy;
import org.eclipse.emf.cdo.session.CDORepositoryInfo;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
@@ -73,6 +74,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.spi.cdo.CDOPermissionUpdater;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol.RefreshSessionResult;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol.RefreshSessionResult.Provider;
@@ -465,7 +467,8 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
/**
* @author Eike Stepper
*/
- private final class ServerCDOSession extends PlatformObject implements InternalCDOSession, CDORepositoryInfo
+ private final class ServerCDOSession extends PlatformObject
+ implements InternalCDOSession, CDORepositoryInfo, org.eclipse.emf.cdo.session.CDOSession.Options
{
private final IRegistry<String, Object> properties = new HashMapRegistry<String, Object>()
{
@@ -476,6 +479,8 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
}
};
+ private boolean generatedPackageEmulationEnabled;
+
private InternalSession internalSession;
private InternalRepository repository;
@@ -820,7 +825,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
public Options options()
{
- throw new UnsupportedOperationException();
+ return this;
}
public CDOView openView(String durableLockingID)
@@ -1145,5 +1150,80 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
{
throw new UnsupportedOperationException();
}
+
+ public boolean isPassiveUpdateEnabled()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPassiveUpdateEnabled(boolean enabled)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PassiveUpdateMode getPassiveUpdateMode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPassiveUpdateMode(PassiveUpdateMode mode)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public LockNotificationMode getLockNotificationMode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setLockNotificationMode(LockNotificationMode mode)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public CDOSession getContainer()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isGeneratedPackageEmulationEnabled()
+ {
+ return generatedPackageEmulationEnabled;
+ }
+
+ public void setGeneratedPackageEmulationEnabled(boolean generatedPackageEmulationEnabled)
+ {
+ this.generatedPackageEmulationEnabled = generatedPackageEmulationEnabled;
+ }
+
+ public CDOCollectionLoadingPolicy getCollectionLoadingPolicy()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setCollectionLoadingPolicy(CDOCollectionLoadingPolicy policy)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public CDOLobStore getLobCache()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setLobCache(CDOLobStore lobCache)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public CDOPermissionUpdater getPermissionUpdater()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPermissionUpdater(CDOPermissionUpdater permissionUpdater)
+ {
+ throw new UnsupportedOperationException();
+ }
}
}

Back to the top