本文整理了Java中org.apache.shiro.authz.permission.WildcardPermissionResolver.resolvePermission()
方法的一些代码示例,展示了WildcardPermissionResolver.resolvePermission()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WildcardPermissionResolver.resolvePermission()
方法的具体详情如下:
包路径:org.apache.shiro.authz.permission.WildcardPermissionResolver
类名称:WildcardPermissionResolver
方法名:resolvePermission
[英]Returns a new WildcardPermission instance constructed based on the specified permissionString.
[中]返回基于指定的permissionString构造的新WildcardPermission实例。
代码示例来源:origin: apache/shiro
@Test
public void testCaseInsensitive()
{
WildcardPermissionResolver resolver = new WildcardPermissionResolver(false);
assertFalse( "Sensitivity should be false", resolver.isCaseSensitive());
/* this is a round-about test as permissions don't store case sensitivity just lower case
the string. */
WildcardPermission permission = (WildcardPermission) resolver.resolvePermission( "Foo:*" );
assertEquals( "string should be lowercase", "foo:*", permission.toString());
}
代码示例来源:origin: apache/shiro
@Test
public void testCaseSensitive()
{
WildcardPermissionResolver resolver = new WildcardPermissionResolver(true);
assertTrue( "Sensitivity should be true", resolver.isCaseSensitive());
/* this is a round-about test as permissions don't store case sensitivity just lower case
the string. */
WildcardPermission permission = (WildcardPermission) resolver.resolvePermission( "Foo:*" );
assertEquals( "string should be mixed case", "Foo:*", permission.toString());
}
代码示例来源:origin: apache/shiro
@Test
public void testDefaultIsNonCaseSensitive()
{
WildcardPermissionResolver resolver = new WildcardPermissionResolver();
assertFalse( "Default sensitivity should be false", resolver.isCaseSensitive());
/* this is a round-about test as permissions don't store case sensitivity just lower case
the string. */
WildcardPermission permission = (WildcardPermission) resolver.resolvePermission( "Foo:*" );
assertEquals( "string should be lowercase", "foo:*", permission.toString());
}
代码示例来源:origin: be.c4j.ee.security.octopus/octopus-core
@Override
public Permission resolvePermission(String permissionString) {
Permission permission;
if (permissionLookup == null && stringLookup == null) {
if (permissionString.contains(":")) {
permission = super.resolvePermission(permissionString);
} else {
permission = super.resolvePermission(permissionString + ":*:*");
}
} else {
if (permissionLookup != null) {
permission = permissionLookup.getPermission(permissionString);
} else {
permission = stringLookup.getPermission(permissionString);
}
}
return permission;
}
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
Permission neededPermission = resolver.resolvePermission(neededPermissionString);
内容来源于网络,如有侵权,请联系作者删除!