X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=security%2Fruntime%2Forg.argeo.security.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fcore%2FDefaultSecurityService.java;h=d6ff69cc23b549632e26edfbe4f93a7ac081b0ad;hb=d685633924a5ee0328f5053b375564ca8fe969e6;hp=b9220b2692af7305657593944012b950cc96754c;hpb=c95922edc1d65ef4ef568d66e29ab0bd679693ef;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/core/DefaultSecurityService.java b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/core/DefaultSecurityService.java index b9220b269..d6ff69cc2 100644 --- a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/core/DefaultSecurityService.java +++ b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/core/DefaultSecurityService.java @@ -16,6 +16,9 @@ package org.argeo.security.core; +import java.util.Iterator; +import java.util.List; + import org.argeo.ArgeoException; import org.argeo.security.ArgeoSecurity; import org.argeo.security.ArgeoSecurityDao; @@ -69,7 +72,7 @@ public class DefaultSecurityService implements ArgeoSecurityService { } public void newUser(ArgeoUser user) { - user.getUserNatures().clear(); +// user.getUserNatures().clear(); argeoSecurity.beforeCreate(user); securityDao.create(user); } @@ -115,6 +118,19 @@ public class DefaultSecurityService implements ArgeoSecurityService { }; } + public List listUsersInRole(String role) { + List lst = securityDao.listUsersInRole(role); + Iterator it = lst.iterator(); + while (it.hasNext()) { + if (it.next().getUsername() + .equals(argeoSecurity.getSuperUsername())) { + it.remove(); + break; + } + } + return lst; + } + public void setArgeoSecurity(ArgeoSecurity argeoSecurity) { this.argeoSecurity = argeoSecurity; }