X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Facr%2Fdirectory%2FRoleContent.java;h=64feb1d6735955310ee458a00c50a53adbe842c8;hb=55d88fba80cec198a0f11ba7545e19878c51fc5e;hp=356e272c90adeae7db1d120f238be7f83d239f06;hpb=feddb4be70a8304dd4a533efee6e14c22691b500;p=lgpl%2Fargeo-commons.git
diff --git a/org.argeo.cms/src/org/argeo/cms/acr/directory/RoleContent.java b/org.argeo.cms/src/org/argeo/cms/acr/directory/RoleContent.java
index 356e272c9..64feb1d67 100644
--- a/org.argeo.cms/src/org/argeo/cms/acr/directory/RoleContent.java
+++ b/org.argeo.cms/src/org/argeo/cms/acr/directory/RoleContent.java
@@ -8,9 +8,7 @@ import org.argeo.api.acr.Content;
import org.argeo.api.acr.ContentName;
import org.argeo.api.acr.spi.ProvidedSession;
import org.argeo.api.cms.directory.UserDirectory;
-import org.osgi.service.useradmin.Group;
import org.osgi.service.useradmin.Role;
-import org.osgi.service.useradmin.User;
class RoleContent extends AbstractDirectoryContent {
@@ -43,11 +41,7 @@ class RoleContent extends AbstractDirectoryContent {
@SuppressWarnings("unchecked")
@Override
public A adapt(Class clss) {
- if (clss.equals(Group.class))
- return (A) role;
- else if (clss.equals(User.class))
- return (A) role;
- else if (clss.equals(Role.class))
+ if (Role.class.isAssignableFrom(clss))
return (A) role;
return super.adapt(clss);
}