Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-21 20:53:54 -0400
committerEike Stepper2013-09-21 20:53:54 -0400
commitdc8364330b7013c4edd54ef30b9d74f7ad9f234a (patch)
tree28d39377c79c7f4c4a0f70c85725b88a7a271237 /plugins/org.eclipse.emf.cdo.server.security
parent32b9825d0d19b5bd18e4c3bf4d66b5312f0551d3 (diff)
downloadcdo-dc8364330b7013c4edd54ef30b9d74f7ad9f234a.tar.gz
cdo-dc8364330b7013c4edd54ef30b9d74f7ad9f234a.tar.xz
cdo-dc8364330b7013c4edd54ef30b9d74f7ad9f234a.zip
Add convenience constructors to PasswordCredentials
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.security')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.security/src/org/eclipse/emf/cdo/server/internal/security/SecurityManager.java13
1 files changed, 10 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 72c4ddd507..97a7a7d1c3 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
@@ -63,6 +63,7 @@ import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.security.IAuthenticator;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
import org.eclipse.emf.common.util.EList;
@@ -258,6 +259,11 @@ public class SecurityManager extends Lifecycle implements InternalSecurityManage
return result[0];
}
+ public User addUser(IPasswordCredentials credentials)
+ {
+ return addUser(credentials.getUserID(), new String(credentials.getPassword()));
+ }
+
public User setPassword(final String id, final String password)
{
final User[] result = { null };
@@ -532,11 +538,12 @@ public class SecurityManager extends Lifecycle implements InternalSecurityManage
// Create roles
Role allReaderRole = realm.addRole("All Objects Reader");
- allReaderRole.getPermissions().add(factory.createFilterPermission(Access.READ, factory.createResourceFilter(".*")));
+ allReaderRole.getPermissions().add(
+ factory.createFilterPermission(Access.READ, factory.createResourceFilter(".*", Inclusion.REGEX)));
Role allWriterRole = realm.addRole("All Objects Writer");
- allWriterRole.getPermissions()
- .add(factory.createFilterPermission(Access.WRITE, factory.createResourceFilter(".*")));
+ allWriterRole.getPermissions().add(
+ factory.createFilterPermission(Access.WRITE, factory.createResourceFilter(".*", Inclusion.REGEX)));
Role treeReaderRole = realm.addRole("Resource Tree Reader");
treeReaderRole.getPermissions().add(

Back to the top