@Override
  protected void fillUserRoles(
      Set<SilverpeasRole> userRoles,
      AccessControlContext context,
      String userId,
      String componentId) {
    // Personal space or user tool
    if (componentId == null || getOrganisationController().isToolAvailable(componentId)) {
      userRoles.add(SilverpeasRole.admin);
      return;
    }
    if (Admin.ADMIN_COMPONENT_ID.equals(componentId)) {
      if (getOrganisationController().getUserDetail(userId).isAccessAdmin()) {
        userRoles.add(SilverpeasRole.admin);
      }
      return;
    }

    ComponentInst componentInst = getOrganisationController().getComponentInst(componentId);
    if (componentInst == null) {
      return;
    }

    if (componentInst.isPublic()
        || StringUtil.getBooleanValue(
            getOrganisationController().getComponentParameterValue(componentId, "publicFiles"))) {
      userRoles.add(SilverpeasRole.user);
      if (!CollectionUtils.containsAny(
              AccessControlOperation.PERSIST_ACTIONS, context.getOperations())
          && !context.getOperations().contains(AccessControlOperation.download)) {
        // In that case, it is not necessary to check deeper the user rights
        return;
      }
    }

    if (getOrganisationController().isComponentAvailable(componentId, userId)) {
      Set<SilverpeasRole> roles =
          SilverpeasRole.from(getOrganisationController().getUserProfiles(userId, componentId));
      // If component is available, but user has no rights -> public component
      if (roles.isEmpty()) {
        userRoles.add(SilverpeasRole.user);
      } else {
        userRoles.addAll(roles);
      }
    }
  }