List of usage examples for org.apache.shiro.authz ModularRealmAuthorizer setPermissionResolver
public void setPermissionResolver(PermissionResolver permissionResolver)
From source file:com.yea.shiro.mgt.ShiroSecurityManager.java
License:Apache License
public ShiroSecurityManager() { super();//www . j a v a2s . co m // authenticator ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator(); authenticator.setAuthenticationStrategy(new AtLeastOneSuccessfulStrategy()); setAuthenticator(authenticator); // authorizer ModularRealmAuthorizer authorizer = new ModularRealmAuthorizer(); authorizer.setPermissionResolver(new WildcardPermissionResolver()); setAuthorizer(authorizer); // ?Matcher credentialsMatcher = new RetryLimitHashedCredentialsMatcher(); credentialsMatcher.setHashAlgorithmName(EncrytPassword.PASSWORD_HASH); credentialsMatcher.setHashIterations(EncrytPassword.HASH_ITERATIONS); credentialsMatcher.setStoredCredentialsHexEncoded(true); }
From source file:com.yea.shiro.web.mgt.WebSecurityManager.java
License:Apache License
public WebSecurityManager() { super();/* w ww . j a va 2 s.c o m*/ // authenticator ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator(); authenticator.setAuthenticationStrategy(new AtLeastOneSuccessfulStrategy()); setAuthenticator(authenticator); // authorizer ModularRealmAuthorizer authorizer = new ModularRealmAuthorizer(); authorizer.setPermissionResolver(new WildcardPermissionResolver()); setAuthorizer(authorizer); // ?Matcher credentialsMatcher = new RetryLimitHashedCredentialsMatcher(); credentialsMatcher.setHashAlgorithmName(EncrytPassword.PASSWORD_HASH); credentialsMatcher.setHashIterations(EncrytPassword.HASH_ITERATIONS); credentialsMatcher.setStoredCredentialsHexEncoded(true); }
From source file:org.owasp.dependencytrack.config.SecurityConfiguration.java
License:Open Source License
@Bean public Authorizer authorizer(DataSource datasource, Realm realm) { ModularRealmAuthorizer modularRealmAuthorizer = new ModularRealmAuthorizer(Arrays.asList(realm)); modularRealmAuthorizer.setPermissionResolver(permissionResolver()); return modularRealmAuthorizer; }