Codota Logo
SecureCatalogImpl.buildWrapperPolicy
Code IndexAdd Codota to your IDE (free)

How to use
buildWrapperPolicy
method
in
org.geoserver.security.SecureCatalogImpl

Best Java code snippets using org.geoserver.security.SecureCatalogImpl.buildWrapperPolicy (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: geoserver/geoserver

static WrapperPolicy buildWrapperPolicy(
    ResourceAccessManager accessManager,
    Authentication user,
    CatalogInfo info,
    String resourceName,
    MixedModeBehavior mixedModeBehavior) {
  return buildWrapperPolicy(
      accessManager,
      user,
      info,
      resourceName,
      mixedModeBehavior,
      Collections.emptyList());
}
origin: geoserver/geoserver

protected WrapperPolicy buildWrapperPolicy(
    Authentication user, @Nonnull CatalogInfo info, MixedModeBehavior mixedModeBehavior) {
  return buildWrapperPolicy(accessManager, user, info, mixedModeBehavior);
}
origin: geoserver/geoserver

/**
 * Factors out the policy that decides what access level the current user has to a specific
 * resource considering the read/write access, the security mode, and the filtering status
 *
 * @param user
 * @param canRead
 * @param canWrite
 * @param resourceName
 */
public WrapperPolicy buildWrapperPolicy(
    Authentication user,
    CatalogInfo info,
    String resourceName,
    MixedModeBehavior mixedModeBehavior) {
  return SecureCatalogImpl.buildWrapperPolicy(
      accessManager,
      user,
      info,
      resourceName,
      mixedModeBehavior,
      Collections.emptyList());
}
origin: geoserver/geoserver

/** Given a workspace and user, returns it back if the user can access it, null otherwise */
protected <T extends WorkspaceInfo> T checkAccess(
    Authentication user, T ws, MixedModeBehavior mixedModeBehavior) {
  if (ws == null) return null;
  WrapperPolicy policy = buildWrapperPolicy(user, ws, ws.getName(), mixedModeBehavior);
  // if we don't need to hide it, then we can return it as is since it
  // can only provide metadata.
  if (policy.level == AccessLevel.HIDDEN) return null;
  else return ws;
}
origin: geoserver/geoserver

/**
 * Given a {@link StyleInfo} and a user, returns it back if the user can access it.
 *
 * @return <code>null</code> if the user can't acess the style, otherwise the original style.
 */
protected StyleInfo checkAccess(
    Authentication user, StyleInfo style, MixedModeBehavior mixedModeBehavior) {
  if (style == null) return null;
  WrapperPolicy policy = buildWrapperPolicy(user, style, style.getName(), mixedModeBehavior);
  // if we don't need to hide it, then we can return it as is since it
  // can only provide metadata.
  if (policy.level == AccessLevel.HIDDEN) return null;
  else return style;
}
origin: geoserver/geoserver

/**
 * Given a store and a user, returns it back if the user can access its workspace in read mode,
 * null otherwise
 */
protected <T extends StoreInfo> T checkAccess(
    Authentication user, T store, MixedModeBehavior mixedModeBehavior) {
  if (store == null) return null;
  WrapperPolicy policy =
      buildWrapperPolicy(user, store.getWorkspace(), store.getName(), mixedModeBehavior);
  // handle the modes that do not require wrapping
  if (policy.level == AccessLevel.HIDDEN) return null;
  else if (policy.level == AccessLevel.READ_WRITE
      || (policy.level == AccessLevel.READ_ONLY && store instanceof CoverageStoreInfo))
    return store;
  // otherwise we are in a mixed case where the user can read but not
  // write, or
  // cannot read but is allowed by the operation mode to access the
  // metadata
  if (store instanceof DataStoreInfo
      || store instanceof CoverageStoreInfo
      || store instanceof WMSStoreInfo
      || store instanceof WMTSStoreInfo) {
    return (T) SecuredObjects.secure(store, policy);
  } else {
    throw new RuntimeException("Unknown store type " + store.getClass());
  }
}
origin: geoserver/geoserver

/** Given a layer and a user, returns it back if the user can access it, null otherwise */
protected LayerInfo checkAccess(
    Authentication user,
    LayerInfo layer,
    MixedModeBehavior mixedModeBehavior,
    List<LayerGroupInfo> containers) {
  if (layer == null) return null;
  // first off, handle the case where the user cannot even read the data
  WrapperPolicy policy =
      buildWrapperPolicy(user, layer, layer.getName(), mixedModeBehavior, containers);
  // handle the modes that do not require wrapping
  if (policy.level == AccessLevel.HIDDEN) return null;
  else if (policy.level == AccessLevel.READ_WRITE && policy.getLimits() == null) return layer;
  // otherwise we are in a mixed case where the user can read but not write, or
  // cannot read but is allowed by the operation mode to access the metadata
  return (LayerInfo) SecuredObjects.secure(layer, policy);
}
origin: geoserver/geoserver

/**
 * Given a {@link FeatureTypeInfo} and a user, returns it back if the user can access it in
 * write mode, makes it read only if the user can access it in read only mode, returns null
 * otherwise
 */
protected <T extends ResourceInfo> T checkAccess(
    Authentication user, T info, MixedModeBehavior mixedModeBehavior) {
  // handle null case
  if (info == null) return null;
  // first off, handle the case where the user cannot even read the data
  WrapperPolicy policy = buildWrapperPolicy(user, info, info.getName(), mixedModeBehavior);
  // handle the modes that do not require wrapping
  if (policy.level == AccessLevel.HIDDEN) return null;
  else if (policy.level == AccessLevel.READ_WRITE && policy.getLimits() == null) return info;
  // otherwise we are in a mixed case where the user can read but not write, or
  // cannot read but is allowed by the operation mode to access the metadata
  return (T) SecuredObjects.secure(info, policy);
}
origin: geoserver/geoserver

    buildWrapperPolicy(user, group, group.getName(), mixedModeBehavior, containers);
if (policy.level == AccessLevel.HIDDEN) {
  return null;
origin: geoserver/geoserver

  ws.setName(((NamespaceInfo) info).getPrefix());
return buildWrapperPolicy(accessManager, user, ws, ws.getName(), mixedModeBehavior);
return buildWrapperPolicy(
    accessManager, user, info, ((WorkspaceInfo) info).getName(), mixedModeBehavior);
return buildWrapperPolicy(
    accessManager,
    user,
return buildWrapperPolicy(
    accessManager, user, info, ((ResourceInfo) info).getName(), mixedModeBehavior);
return buildWrapperPolicy(
    accessManager, user, info, ((LayerInfo) info).getName(), mixedModeBehavior);
      buildWrapperPolicy(
          accessManager, user, layer, layer.getName(), mixedModeBehavior);
  if (AccessLevel.HIDDEN.equals(policy.getAccessLevel())) {
return buildWrapperPolicy(
    accessManager, user, info, ((StyleInfo) info).getName(), mixedModeBehavior);
origin: geoserver/geoserver

  @Override
  public Boolean evaluate(Object object) {
    CatalogInfo info = (CatalogInfo) object;
    if (info instanceof NamespaceInfo) {
      info = getCatalog().getWorkspaceByName(((NamespaceInfo) info).getPrefix());
    }
    if (info == null) {
      return false;
    }
    WrapperPolicy policy =
        getSecurityWrapper()
            .buildWrapperPolicy(
                resourceAccesssManager, user, info, MixedModeBehavior.HIDE);
    AccessLevel accessLevel = policy.getAccessLevel();
    boolean visible = !AccessLevel.HIDDEN.equals(accessLevel);
    return Boolean.valueOf(visible);
  }
}
org.geoserver.securitySecureCatalogImplbuildWrapperPolicy

Javadoc

Check how an access manager responds to a user accessing a catalog object and return the result.

Popular methods of SecureCatalogImpl

  • unwrap
  • getCoverageByName
  • getCoverageStoreByName
  • getCoverages
  • getDataStoreByName
  • getFeatureTypeByName
  • getFeatureTypes
  • getLayerByName
  • getLayerGroupByName
  • getLayerGroups
  • getLayers
  • getResourceByName
  • getLayers,
  • getResourceByName,
  • getStyles,
  • getWorkspaceByName,
  • getWorkspaces,
  • list,
  • <init>,
  • buildDefaultResourceAccessManager,
  • checkAccess

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • addToBackStack (FragmentTransaction)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • JButton (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now