test_class.declarator: cacheManager
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private CacheManager cacheManager;
test_class.type: CacheManager
test_class.var_name: cacheManager
test_class.declarator: securityHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private SecurityHelper securityHelper;
test_class.type: SecurityHelper
test_class.var_name: securityHelper
test_class.file: herd-code/herd-app/src/test/java/org/finra/herd/app/security/SecurityHelperTest.java
test_class.identifier: SecurityHelperTest
test_class.superclass: extends AbstractAppTest
test_case.body: @Test
      public void testGetUnrestrictedFunctions()
      {
          // Create a security function not mapped to any of the security roles.
          SecurityFunctionEntity securityFunctionEntity = new SecurityFunctionEntity();
          securityFunctionEntity.setCode(SECURITY_FUNCTION);
          herdDao.saveAndRefresh(securityFunctionEntity);
  
          // Clear the cache.
          cacheManager.getCache(DaoSpringModuleConfig.HERD_CACHE_NAME).clear();
  
          // Get unrestricted functions.
          Set<GrantedAuthority> result = securityHelper.getUnrestrictedFunctions();
  
          // Validate that result list contains the test security function.
          assertTrue(result.contains(new SimpleGrantedAuthority(SECURITY_FUNCTION)));
      }
test_case.class_method_signature: SecurityHelperTest.testGetUnrestrictedFunctions()
test_case.full_signature: @Test public void testGetUnrestrictedFunctions()
test_case.identifier: testGetUnrestrictedFunctions
test_case.invocations: setCode saveAndRefresh clear getCache getUnrestrictedFunctions assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetUnrestrictedFunctions()
focal_class.declarator: configurationHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ConfigurationHelper configurationHelper;
focal_class.type: ConfigurationHelper
focal_class.var_name: configurationHelper
focal_class.declarator: spelExpressionHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SpelExpressionHelper spelExpressionHelper;
focal_class.type: SpelExpressionHelper
focal_class.var_name: spelExpressionHelper
focal_class.file: herd-code/herd-app/src/main/java/org/finra/herd/app/security/SecurityHelper.java
focal_class.identifier: SecurityHelper
focal_class.class_method_signature: SecurityHelper.getUnrestrictedFunctions()
focal_class.full_signature: public Set<GrantedAuthority> getUnrestrictedFunctions()
focal_class.identifier: getUnrestrictedFunctions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<GrantedAuthority>
focal_class.signature: Set<GrantedAuthority> getUnrestrictedFunctions()
focal_class.class_method_signature: SecurityHelper.isSecurityEnabled(HttpServletRequest request)
focal_class.full_signature: public boolean isSecurityEnabled(HttpServletRequest request)
focal_class.identifier: isSecurityEnabled
focal_class.modifiers: public
focal_class.parameters: (HttpServletRequest request)
focal_class.return: boolean
focal_class.signature: boolean isSecurityEnabled(HttpServletRequest request)
focal_class.class_method_signature: SecurityHelper.isUserGeneratedByClass(Authentication authentication, Class<?> generatedByClass)
focal_class.full_signature: public boolean isUserGeneratedByClass(Authentication authentication, Class<?> generatedByClass)
focal_class.identifier: isUserGeneratedByClass
focal_class.modifiers: public
focal_class.parameters: (Authentication authentication, Class<?> generatedByClass)
focal_class.return: boolean
focal_class.signature: boolean isUserGeneratedByClass(Authentication authentication, Class<?> generatedByClass)
focal_class.class_method_signature: SecurityHelper.mapRolesToFunctions(Collection<String> roles)
focal_class.full_signature: public Set<GrantedAuthority> mapRolesToFunctions(Collection<String> roles)
focal_class.identifier: mapRolesToFunctions
focal_class.modifiers: public
focal_class.parameters: (Collection<String> roles)
focal_class.return: Set<GrantedAuthority>
focal_class.signature: Set<GrantedAuthority> mapRolesToFunctions(Collection<String> roles)
focal_method.body: public Set<GrantedAuthority> getUnrestrictedFunctions()
      {
          // TODO Getting HerdDao from applicationContext statically because if we try to wire HerdDao here it does not get constructed with proxy class that is
          // needed for @Cacheable methods to work.
          SecurityFunctionDao securityFunctionDao = ApplicationContextHolder.getApplicationContext().getBean(SecurityFunctionDao.class);
  
          Set<GrantedAuthority> authorities = new HashSet<>();
  
          // Add all unrestricted functional points.
          for (String function : securityFunctionDao.getUnrestrictedSecurityFunctions())
          {
              authorities.add(new SimpleGrantedAuthority(function));
          }
  
          return authorities;
      }
focal_method.class_method_signature: SecurityHelper.getUnrestrictedFunctions()
focal_method.full_signature: public Set<GrantedAuthority> getUnrestrictedFunctions()
focal_method.identifier: getUnrestrictedFunctions
focal_method.invocations: getBean getApplicationContext getUnrestrictedSecurityFunctions add
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Set<GrantedAuthority>
focal_method.signature: Set<GrantedAuthority> getUnrestrictedFunctions()