org.apache.shiro.authz.permission.WildcardPermissionResolver.resolvePermission()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(112)

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

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);

相关文章