X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.ext.jackrabbit%2Fsrc%2Forg%2Fargeo%2Fsecurity%2Fjackrabbit%2FArgeoSecurityManager.java;h=15199c0ce6df15eee4c9692d1d15ef9048bc3916;hb=e41e2a4bcda502518826334ecdfaa25bcaed979b;hp=fde490d2edb9273cdc62453225e40d2a849ebfdb;hpb=9d0201c5b057929fb029f484f082d0e011e15673;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.ext.jackrabbit/src/org/argeo/security/jackrabbit/ArgeoSecurityManager.java b/org.argeo.ext.jackrabbit/src/org/argeo/security/jackrabbit/ArgeoSecurityManager.java index fde490d2e..15199c0ce 100644 --- a/org.argeo.ext.jackrabbit/src/org/argeo/security/jackrabbit/ArgeoSecurityManager.java +++ b/org.argeo.ext.jackrabbit/src/org/argeo/security/jackrabbit/ArgeoSecurityManager.java @@ -64,6 +64,18 @@ public class ArgeoSecurityManager extends DefaultSecurityManager { throw new IllegalStateException("Inconsistent " + subject); else return NodeConstants.ROLE_ANONYMOUS; + } else if (isRegularUser) {// must be before DataAdmin + if (isAnonymous || isJackrabbitSystem) + throw new IllegalStateException("Inconsistent " + subject); + else { + if (userPrincipal.size() > 1) { + StringBuilder buf = new StringBuilder(); + for (X500Principal principal : userPrincipal) + buf.append(' ').append('\"').append(principal).append('\"'); + throw new RuntimeException("Multiple user principals:" + buf); + } + return userPrincipal.iterator().next().getName(); + } } else if (isDataAdmin) { if (isAnonymous || isJackrabbitSystem || isRegularUser) throw new IllegalStateException("Inconsistent " + subject); @@ -76,18 +88,6 @@ public class ArgeoSecurityManager extends DefaultSecurityManager { throw new IllegalStateException("Inconsistent " + subject); else return super.getUserID(subject, workspaceName); - } else if (isRegularUser) { - if (isAnonymous || isDataAdmin || isJackrabbitSystem) - throw new IllegalStateException("Inconsistent " + subject); - else { - if (userPrincipal.size() > 1) { - StringBuilder buf = new StringBuilder(); - for (X500Principal principal : userPrincipal) - buf.append(' ').append('\"').append(principal).append('\"'); - throw new RuntimeException("Multiple user principals:" + buf); - } - return userPrincipal.iterator().next().getName(); - } } else { throw new IllegalStateException("Unrecognized subject type: " + subject); }