gpt4 book ai didi

org.geoserver.security.WorkspaceAccessLimits.isAdminable()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 16:09:05 28 4
gpt4 key购买 nike

本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.isAdminable()方法的一些代码示例,展示了WorkspaceAccessLimits.isAdminable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceAccessLimits.isAdminable()方法的具体详情如下:
包路径:org.geoserver.security.WorkspaceAccessLimits
类名称:WorkspaceAccessLimits
方法名:isAdminable

WorkspaceAccessLimits.isAdminable介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

protected WorkspaceAccessLimits intersection(WorkspaceAccessLimits a, WorkspaceAccessLimits b) {
  CatalogMode mode = intersection(a.getMode(), b.getMode());
  return new WorkspaceAccessLimits(
      mode,
      a.isReadable() && b.isReadable(),
      a.isWritable() && b.isWritable(),
      a.isAdminable() && b.isAdminable());
}

代码示例来源:origin: geoserver/geoserver

WorkspaceAccessLimits wl = (WorkspaceAccessLimits) limits;
if (wl != null) {
  if (wl.isAdminable()) {
    canRead = canWrite = true;
  } else {
  if (wl == null || !wl.isAdminable()) {
    canRead = canWrite = false;
  if (wl != null && !wl.isAdminable()) {
    canRead = false;
  WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, ws);
  if (wl != null) {
    if (!wl.isAdminable()) {
      canRead = false;

代码示例来源:origin: org.geoserver.web/gs-web-core

/** Check if the current user has any admin privilege on at least one workspace. */
  boolean isWorkspaceAdmin(Authentication authentication) {

    Catalog catalog = getSecurityManager().getCatalog();

    // the secure catalog builds and owns the ResourceAccessManager
    SecureCatalogImpl secureCatalog =
        GeoServerApplication.get().getBeanOfType(SecureCatalogImpl.class);
    ResourceAccessManager manager = secureCatalog.getResourceAccessManager();

    if (manager != null) {
      for (WorkspaceInfo workspace : catalog.getWorkspaces()) {
        WorkspaceAccessLimits accessLimits =
            manager.getAccessLimits(authentication, workspace);
        if (accessLimits != null && accessLimits.isAdminable()) {
          return true;
        }
      }
    }

    return false;
  }
}

代码示例来源:origin: org.geoserver.security/gs-security-tests

private boolean canAccess(
      ResourceAccessManager manager,
      Authentication user,
      WorkspaceInfo catalogInfo,
      AccessMode mode) {
    WorkspaceAccessLimits limits = manager.getAccessLimits(user, catalogInfo);
    if (limits == null) {
      return true;
    } else if (mode == AccessMode.READ) {
      return limits.isReadable();
    } else if (mode == AccessMode.WRITE) {
      return limits.isWritable();
    } else if (mode == AccessMode.ADMIN) {
      return limits.isAdminable();
    } else {
      throw new RuntimeException("Unknown access mode " + mode);
    }
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com