use of org.apache.shiro.authz.SimpleAuthorizationInfo in project killbill by killbill.
the class KillBillJndiLdapRealm method queryForAuthorizationInfo.
@Override
protected AuthorizationInfo queryForAuthorizationInfo(final PrincipalCollection principals, final LdapContextFactory ldapContextFactory) throws NamingException {
final Set<String> userGroups = findLDAPGroupsForUser(principals, ldapContextFactory);
final SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo(userGroups);
final Set<String> stringPermissions = groupsPermissions(userGroups);
simpleAuthorizationInfo.setStringPermissions(stringPermissions);
return simpleAuthorizationInfo;
}
use of org.apache.shiro.authz.SimpleAuthorizationInfo in project killbill by killbill.
the class KillBillOktaRealm method doGetAuthorizationInfo.
@Override
protected AuthorizationInfo doGetAuthorizationInfo(final PrincipalCollection principals) {
final String username = (String) getAvailablePrincipal(principals);
final String userId = findOktaUserId(username);
final Set<String> userGroups = findOktaGroupsForUser(userId);
final SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo(userGroups);
final Set<String> stringPermissions = groupsPermissions(userGroups);
simpleAuthorizationInfo.setStringPermissions(stringPermissions);
return simpleAuthorizationInfo;
}
use of org.apache.shiro.authz.SimpleAuthorizationInfo in project ssm_shiro_blog by Mandelo.
the class MyRealm method doGetAuthorizationInfo.
/**
* 登录之后用于授权
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
String username = (String) principals.getPrimaryPrincipal();
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
authorizationInfo.setRoles(new HashSet<>(userExtendDao.getRoles(username)));
authorizationInfo.setStringPermissions(new HashSet<>(userExtendDao.getPermissions(username)));
return authorizationInfo;
}
Aggregations