private AuthorEntity(final UserDetail userDetail) {
   if (userDetail != null) {
     this.fullName = userDetail.getDisplayedName();
     this.id = userDetail.getId();
     this.avatar = userDetail.getAvatar();
     UserPreferences prefs = getUserPreferences();
     if (prefs != null) {
       this.language = prefs.getLanguage();
     } else {
       this.language = DisplayI18NHelper.getDefaultLanguage();
     }
   }
 }
 @Override
 public void onDeletion(final UserEvent event) throws Exception {
   UserDetail user = event.getTransition().getBefore();
   kmeliaService.userHaveBeenDeleted(user.getId());
 }
Example #3
0
 /**
  * Is the specified user can access this comment?
  *
  * <p>A user can access a comment if it has enough rights to access the application instance in
  * which is managed this comment.
  *
  * <p>Be caution, the access control on the commented resource is usually more reliable than using
  * this method.
  *
  * @param user a user in Silverpeas.
  * @return true if the user can access this comment, false otherwise.
  */
 @Override
 public boolean canBeAccessedBy(final UserDetail user) {
   AccessController<String> accessController =
       AccessControllerProvider.getAccessController(ComponentAccessControl.class);
   return accessController.isUserAuthorized(user.getId(), getComponentInstanceId());
 }