- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.isWritable()
方法的一些代码示例,展示了WorkspaceAccessLimits.isWritable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceAccessLimits.isWritable()
方法的具体详情如下:
包路径:org.geoserver.security.WorkspaceAccessLimits
类名称:WorkspaceAccessLimits
方法名:isWritable
暂无
代码示例来源: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
} else {
canRead = wl.isReadable();
canWrite = wl.isWritable();
代码示例来源:origin: org.geoserver.community/gs-geofence
@Test
public void testCiteCannotWriteOnWorkspace() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(false);
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"cite",
"cite",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_AUTHENTICATED")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertFalse(wl.isWritable());
}
代码示例来源:origin: org.geoserver.extension/gs-geofence
@Test
public void testCiteCannotWriteOnWorkspace() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(false);
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"cite",
"cite",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_AUTHENTICATED")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertFalse(wl.isWritable());
}
代码示例来源: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);
}
}
}
代码示例来源:origin: org.geoserver.extension/gs-geofence
@Test
public void testCiteCanWriteOnWorkspace() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(true);
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"cite",
"cite",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_AUTHENTICATED")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(false);
}
代码示例来源:origin: org.geoserver.community/gs-geofence
@Test
public void testCiteCanWriteOnWorkspace() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(true);
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"cite",
"cite",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_AUTHENTICATED")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
configManager.getConfiguration().setGrantWriteToWorkspacesToAuthenticatedUsers(false);
}
代码示例来源:origin: org.geoserver.community/gs-geofence
public void IGNOREtestCiteWorkspaceAccess() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken("cite", "cite");
// check workspace access on cite
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
// check workspace access on any other but not cite and sf (should fail)
WorkspaceInfo cdfWS = catalog.getWorkspaceByName(MockData.CDF_PREFIX);
wl = accessManager.getAccessLimits(user, cdfWS);
assertFalse(wl.isReadable());
assertFalse(wl.isWritable());
// check workspace access on sf (should work, we can do at least a getmap)
WorkspaceInfo sfWS = catalog.getWorkspaceByName(MockData.SF_PREFIX);
wl = accessManager.getAccessLimits(user, sfWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
}
代码示例来源:origin: org.geoserver.extension/gs-geofence
@Test
public void testCiteWorkspaceAccess() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken("cite", "cite");
// check workspace access on cite
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
// check workspace access on any other but not cite and sf (should fail)
WorkspaceInfo cdfWS = catalog.getWorkspaceByName(MockData.CDF_PREFIX);
wl = accessManager.getAccessLimits(user, cdfWS);
assertFalse(wl.isReadable());
assertFalse(wl.isWritable());
// check workspace access on sf (should work, we can do at least a getmap)
WorkspaceInfo sfWS = catalog.getWorkspaceByName(MockData.SF_PREFIX);
wl = accessManager.getAccessLimits(user, sfWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
}
代码示例来源:origin: org.geoserver.community/gs-geofence
@Test
public void testAdmin() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"admin",
"geoserver",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_ADMINISTRATOR")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
// check layer access
LayerInfo layer = catalog.getLayerByName(getLayerId(MockData.BASIC_POLYGONS));
VectorAccessLimits vl = (VectorAccessLimits) accessManager.getAccessLimits(user, layer);
assertEquals(Filter.INCLUDE, vl.getReadFilter());
assertEquals(Filter.INCLUDE, vl.getWriteFilter());
assertNull(vl.getReadAttributes());
assertNull(vl.getWriteAttributes());
}
代码示例来源:origin: org.geoserver.extension/gs-geofence
@Test
public void testAdmin() {
if (!IS_GEOFENCE_AVAILABLE) {
return;
}
assertTrue(geofenceAdminService.getCountAll() > 0);
RuleFilter ruleFilter = new RuleFilter();
ShortRule adminRule = geofenceAdminService.getRule(ruleFilter);
UsernamePasswordAuthenticationToken user =
new UsernamePasswordAuthenticationToken(
"admin",
"geoserver",
Arrays.asList(
new GrantedAuthority[] {
new SimpleGrantedAuthority("ROLE_ADMINISTRATOR")
}));
// check workspace access
WorkspaceInfo citeWS = catalog.getWorkspaceByName(MockData.CITE_PREFIX);
WorkspaceAccessLimits wl = accessManager.getAccessLimits(user, citeWS);
assertTrue(wl.isReadable());
assertTrue(wl.isWritable());
// check layer access
LayerInfo layer = catalog.getLayerByName(getLayerId(MockData.BASIC_POLYGONS));
VectorAccessLimits vl = (VectorAccessLimits) accessManager.getAccessLimits(user, layer);
assertEquals(Filter.INCLUDE, vl.getReadFilter());
assertEquals(Filter.INCLUDE, vl.getWriteFilter());
assertNull(vl.getReadAttributes());
assertNull(vl.getWriteAttributes());
}
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.()方法的一些代码示例,展示了WorkspaceAccessLimits.()的具体用法。
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.isReadable()方法的一些代码示例,展示了WorkspaceAccessLimit
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.isAdminable()方法的一些代码示例,展示了WorkspaceAccessLimi
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits.isWritable()方法的一些代码示例,展示了WorkspaceAccessLimit
我是一名优秀的程序员,十分优秀!