Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-10 07:31:56 +0000
committerEike Stepper2012-06-10 07:31:56 +0000
commit4e52cc2de62311c6fc7887832702cd26975b912c (patch)
tree2c6e7928fcbbeef674a3003c638ae3fdff03f6c1 /plugins
parent0aedfb4a82e6203143073c560576b33eb74641dd (diff)
downloadcdo-4e52cc2de62311c6fc7887832702cd26975b912c.tar.gz
cdo-4e52cc2de62311c6fc7887832702cd26975b912c.tar.xz
cdo-4e52cc2de62311c6fc7887832702cd26975b912c.zip
[380629] Design a default Security model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=380629
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/ClassCheckImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/PackageCheckImpl.java9
2 files changed, 18 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/ClassCheckImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/ClassCheckImpl.java
index 202357989c..3c60ee1fe5 100644
--- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/ClassCheckImpl.java
+++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/ClassCheckImpl.java
@@ -60,6 +60,15 @@ public class ClassCheckImpl extends CheckImpl implements ClassCheck
public boolean isApplicable(CDORevision revision, CDORevisionProvider revisionProvider, CDOBranchPoint securityContext)
{
+ EClass actualClass = revision.getEClass();
+ for (EClass applicableClass : getClasses())
+ {
+ if (actualClass == applicableClass)
+ {
+ return true;
+ }
+ }
+
return false;
}
diff --git a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/PackageCheckImpl.java b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/PackageCheckImpl.java
index c9e92a09f6..cf6e898697 100644
--- a/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/PackageCheckImpl.java
+++ b/plugins/org.eclipse.emf.cdo.security/src/org/eclipse/emf/cdo/security/impl/PackageCheckImpl.java
@@ -61,6 +61,15 @@ public class PackageCheckImpl extends CheckImpl implements PackageCheck
public boolean isApplicable(CDORevision revision, CDORevisionProvider revisionProvider, CDOBranchPoint securityContext)
{
+ EPackage actualPackage = revision.getEClass().getEPackage();
+ for (EPackage applicablePackage : getPackages())
+ {
+ if (actualPackage == applicablePackage)
+ {
+ return true;
+ }
+ }
+
return false;
}

Back to the top