Tabnine Logo
RoleCalculator.addInheritedRoles
Code IndexAdd Tabnine to your IDE (free)

How to use
addInheritedRoles
method
in
org.geoserver.security.impl.RoleCalculator

Best Java code snippets using org.geoserver.security.impl.RoleCalculator.addInheritedRoles (Showing top 6 results out of 315)

origin: geoserver/geoserver

/**
 * Calculate the {@link GeoServerRole} objects for a group including inherited roles
 *
 * @param group
 * @throws IOException
 */
public SortedSet<GeoServerRole> calculateRoles(GeoServerUserGroup group) throws IOException {
  SortedSet<GeoServerRole> roles = new TreeSet<GeoServerRole>();
  roles.addAll(getRoleService().getRolesForGroup(group.getGroupname()));
  addInheritedRoles(roles);
  return roles;
}
origin: geoserver/geoserver

  /**
   * Implements roles retrieval from the J2EE container.
   *
   * @param request
   * @param principal
   * @throws IOException
   */
  protected Collection<GeoServerRole> getRolesFromJ2EE(
      HttpServletRequest request, String principal) throws IOException {

    Collection<GeoServerRole> roles = new ArrayList<GeoServerRole>();
    boolean useActiveService =
        getRoleServiceName() == null || getRoleServiceName().trim().length() == 0;

    GeoServerRoleService service =
        useActiveService
            ? getSecurityManager().getActiveRoleService()
            : getSecurityManager().loadRoleService(getRoleServiceName());

    for (GeoServerRole role : service.getRoles())
      if (request.isUserInRole(role.getAuthority())) roles.add(role);

    RoleCalculator calc = new RoleCalculator(service);
    calc.addInheritedRoles(roles);
    calc.addMappedSystemRoles(roles);
    return roles;
  }
}
origin: geoserver/geoserver

addInheritedRoles(set1);
origin: org.geoserver.web/gs-web-sec-core

  @Override
  protected List<GeoServerRole> load() {
    List<GeoServerRole> tmp = new ArrayList<GeoServerRole>();
    List<GeoServerRole> result = new ArrayList<GeoServerRole>();
    try {
      GeoServerUserGroupService ugService =
          getSecurityManager().loadUserGroupService(ugServiceName);
      GeoServerRoleService gaService = getSecurityManager().getActiveRoleService();
      RoleCalculator calc = new RoleCalculator(ugService, gaService);
      tmp.addAll(rolePalette.getSelectedRoles());
      calc.addInheritedRoles(tmp);
      for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) {
        if (group.isEnabled()) {
          tmp.addAll(calc.calculateRoles(group));
        }
      }
      result.addAll(calc.personalizeRoles(user, tmp));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    Collections.sort(result);
    return result;
  }
}
origin: org.geoserver.web/web-security

  @Override
  protected List<GeoServerRole> load() {
    List<GeoServerRole> tmp = new ArrayList<GeoServerRole>();
    List<GeoServerRole> result = new ArrayList<GeoServerRole>();
    try {
      GeoServerUserGroupService ugService = getSecurityManager()
          .loadUserGroupService(ugServiceName);
      GeoServerRoleService gaService = getSecurityManager()
          .getActiveRoleService();
      RoleCalculator calc = new RoleCalculator(ugService, gaService);
      tmp.addAll(rolePalette.getSelectedRoles());
      calc.addInheritedRoles(tmp);
      for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) {
        if (group.isEnabled()) {
          tmp.addAll(calc.calculateRoles(group));
        }
      }
      result.addAll(calc.personalizeRoles(user, tmp));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  
    Collections.sort(result);
    return result;
  }
}
origin: org.geoserver.web/web-sec-core

  @Override
  protected List<GeoServerRole> load() {
    List<GeoServerRole> tmp = new ArrayList<GeoServerRole>();
    List<GeoServerRole> result = new ArrayList<GeoServerRole>();
    try {
      GeoServerUserGroupService ugService = getSecurityManager()
          .loadUserGroupService(ugServiceName);
      GeoServerRoleService gaService = getSecurityManager()
          .getActiveRoleService();
      RoleCalculator calc = new RoleCalculator(ugService, gaService);
      tmp.addAll(rolePalette.getSelectedRoles());
      calc.addInheritedRoles(tmp);
      for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) {
        if (group.isEnabled()) {
          tmp.addAll(calc.calculateRoles(group));
        }
      }
      result.addAll(calc.personalizeRoles(user, tmp));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  
    Collections.sort(result);
    return result;
  }
}
org.geoserver.security.implRoleCalculatoraddInheritedRoles

Javadoc

Adds inherited roles to a role set

Popular methods of RoleCalculator

  • <init>
  • calculateRoles
  • personalizeRoles
  • addMappedSystemRoles
  • addParentRole
    Collects the ascendents for a GeoServerRole object
  • assertRoleServiceNotNull
    Check if the role service is not null
  • getRoleService
  • getUserGroupService

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now