]>
git.argeo.org Git - gpl/argeo-slc.git/blob - RoleIconLP.java
8e12eeda14afc5ddf8dfcf7baede4854d2ab97d5
1 package org
.argeo
.cms
.e4
.users
.providers
;
3 import org
.argeo
.api
.cms
.CmsContext
;
4 import org
.argeo
.api
.cms
.CmsConstants
;
5 import org
.argeo
.cms
.auth
.UserAdminUtils
;
6 import org
.argeo
.cms
.e4
.users
.SecurityAdminImages
;
7 import org
.argeo
.util
.naming
.LdapAttrs
;
8 import org
.eclipse
.swt
.graphics
.Image
;
9 import org
.osgi
.service
.useradmin
.Role
;
10 import org
.osgi
.service
.useradmin
.User
;
12 /** Provide a bundle specific image depending on the current user type */
13 public class RoleIconLP
extends UserAdminAbstractLP
{
14 private static final long serialVersionUID
= 6550449442061090388L;
17 public String
getText(User user
) {
22 public Image
getImage(Object element
) {
23 User user
= (User
) element
;
24 String dn
= user
.getName();
25 if (dn
.endsWith(CmsConstants
.SYSTEM_ROLES_BASEDN
))
26 return SecurityAdminImages
.ICON_ROLE
;
27 else if (user
.getType() == Role
.GROUP
) {
28 String businessCategory
= UserAdminUtils
.getProperty(user
, LdapAttrs
.businessCategory
);
29 if (businessCategory
!= null && businessCategory
.equals(CmsContext
.WORKGROUP
))
30 return SecurityAdminImages
.ICON_WORKGROUP
;
31 return SecurityAdminImages
.ICON_GROUP
;
33 return SecurityAdminImages
.ICON_USER
;