@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } Credentials credentials = callerToCredentials.get(validationResult.getCallerPrincipal().getName()); return credentials != null ? new HashSet<>(asList(credentials.groups())) : emptySet(); }
@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } Credentials credentials = callerToCredentials.get(validationResult.getCallerPrincipal().getName()); return credentials != null ? new HashSet<>(asList(credentials.groups())) : emptySet(); }
@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } DataSource dataSource = getDataSource(); return new HashSet<>(executeQuery( dataSource, dataBaseIdentityStoreDefinition.groupsQuery(), validationResult.getCallerPrincipal().getName()) ); }
@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } DataSource dataSource = getDataSource(); return new HashSet<>(executeQuery( dataSource, dataBaseIdentityStoreDefinition.groupsQuery(), validationResult.getCallerPrincipal().getName()) ); }
@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { // Make sure caller has permission to invoke this method SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } LdapContext searchContext = createSearchLdapContext(); try { String callerDn = validationResult.getCallerDn(); if (callerDn == null || callerDn.isEmpty()) { callerDn = getCallerDn(searchContext, validationResult.getCallerPrincipal().getName()); } return retrieveGroupsForCallerDn(searchContext, callerDn); } finally { closeContext(searchContext); } }
@Override public Set<String> getCallerGroups(CredentialValidationResult validationResult) { // Make sure caller has permission to invoke this method SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) { securityManager.checkPermission(new IdentityStorePermission("getGroups")); } LdapContext searchContext = createSearchLdapContext(); try { String callerDn = validationResult.getCallerDn(); if (callerDn == null || callerDn.isEmpty()) { callerDn = getCallerDn(searchContext, validationResult.getCallerPrincipal().getName()); } return retrieveGroupsForCallerDn(searchContext, callerDn); } finally { closeContext(searchContext); } }