Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-05-26 11:25:30 +0000
committerEike Stepper2012-05-26 11:25:30 +0000
commit137368fbd331c8bde7c7f79c6f103a0145c9d8eb (patch)
tree60f46f6c19fffbb26339f39246c1c7ceab8e257a /plugins
parent5c653bb393c2bea25894ff709c1a424992a9ad6d (diff)
downloadcdo-137368fbd331c8bde7c7f79c6f103a0145c9d8eb.tar.gz
cdo-137368fbd331c8bde7c7f79c6f103a0145c9d8eb.tar.xz
cdo-137368fbd331c8bde7c7f79c6f103a0145c9d8eb.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.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java25
1 files changed, 17 insertions, 8 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 dbd303a08c..16e04e8119 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
@@ -160,10 +160,12 @@ public class SecurityManager implements ISecurityManager, IUserManager, IPermiss
{
EList<SecurityItem> items = realm.getItems();
user = RealmUtil.findUser(items, userID);
- if (user != null)
+ if (user == null)
{
- users.put(userID, user);
+ throw new SecurityException("User " + userID + " not found");
}
+
+ users.put(userID, user);
}
return user;
@@ -195,10 +197,7 @@ public class SecurityManager implements ISecurityManager, IUserManager, IPermiss
public void execute(Realm realm)
{
User user = getUser(userID);
- if (user != null)
- {
- EcoreUtil.remove(user);
- }
+ EcoreUtil.remove(user);
}
});
}
@@ -206,7 +205,16 @@ public class SecurityManager implements ISecurityManager, IUserManager, IPermiss
public byte[] encrypt(String userID, byte[] data, String algorithmName, byte[] salt, int count)
throws SecurityException
{
- return null;
+ User user = getUser(userID);
+ UserPassword userPassword = user.getPassword();
+ String password = userPassword == null ? null : userPassword.getEncrypted();
+ if (password != null)
+ {
+ // TODO
+ }
+
+ // TODO: implement SecurityManager.encrypt(userID, data, algorithmName, salt, count)
+ throw new UnsupportedOperationException();
}
public void modify(RealmOperation operation)
@@ -265,6 +273,7 @@ public class SecurityManager implements ISecurityManager, IUserManager, IPermiss
protected CDOPermission getPermission(CDORevision revision, CDORevisionProvider revisionProvider,
CDOBranchPoint securityContext, User user)
{
- return null;
+ // TODO: implement SecurityManager.getPermission(revision, revisionProvider, securityContext, user)
+ throw new UnsupportedOperationException();
}
}

Back to the top