@Test public void givenPermissionsGrantedOnCiTypeLevelThenShouldBeTreatAsCiTypePermitted() { assertThat(authorizationService.isCiTypePermitted(1007, ACTION_CREATION)).isTrue(); }
@Cacheable("authorizationService-isCiTypePermitted") @Override public boolean isCiTypePermitted(int ciTypeId, String action) { if (!securityProperties.isEnabled()) { log.warn("Security authorization is disabled."); return true; } Authority userAuthority = getUserAuthority(ciTypeId); boolean ciTypePermitted = userAuthority.isCiTypePermitted(action); log.info("Is [{}] on CiType[{}] permitted: {}", action, ciTypeId, ciTypePermitted); return ciTypePermitted; }
AuthorizationServiceImpl implements AuthorizationService { @Cacheable("authorizationService-isCiTypePermitted") @Override public boolean isCiTypePermitted(int ciTypeId, String action) { if (!securityProperties.isEnabled()) { log.warn("Security authorization is disabled."); return true; } Authority userAuthority = getUserAuthority(ciTypeId); boolean ciTypePermitted = userAuthority.isCiTypePermitted(action); log.info("Is [{}] on CiType[{}] permitted: {}", action, ciTypeId, ciTypePermitted); return ciTypePermitted; } }
AuthorizationServiceImpl implements AuthorizationService { @Cacheable("authorizationService-isCiTypePermitted") @Override public boolean isCiTypePermitted(int ciTypeId, String action) { if (!securityProperties.isEnabled()) { log.warn("Security authorization is disabled."); return true; } Authority userAuthority = getUserAuthority(ciTypeId); boolean ciTypePermitted = userAuthority.isCiTypePermitted(action); log.info("Is [{}] on CiType[{}] permitted: {}", action, ciTypeId, ciTypePermitted); return ciTypePermitted; }  }
AuthorizationServiceImpl implements AuthorizationService { @Cacheable("authorizationService-isCiTypePermitted") @Override public boolean isCiTypePermitted(int ciTypeId, String action) { if (!securityProperties.isEnabled()) { log.warn("Security authorization is disabled."); return true; } Authority userAuthority = getUserAuthority(ciTypeId); boolean ciTypePermitted = userAuthority.isCiTypePermitted(action); log.info("Is [{}] on CiType[{}] permitted: {}", action, ciTypeId, ciTypePermitted); return ciTypePermitted; }  @Override void authorizeCiData(int ciTypeId, Object ciData, String action); @Override boolean isCiDataPermitted(int ciTypeId, Object ciData, String action); @Cacheable("authorizationService-isCiTypePermitted") @Override boolean isCiTypePermitted(int ciTypeId, String action); @Cacheable("authorizationService-getPermittedData") @Override List<Map<String, Set<?>>> getPermittedData(int ciTypeId, String action); void setSecurityEnabled(boolean securityEnabled); }
AuthorizationServiceImpl implements AuthorizationService { @Cacheable("authorizationService-isCiTypePermitted") @Override public boolean isCiTypePermitted(int ciTypeId, String action) { if (!securityProperties.isEnabled()) { log.warn("Security authorization is disabled."); return true; } Authority userAuthority = getUserAuthority(ciTypeId); boolean ciTypePermitted = userAuthority.isCiTypePermitted(action); log.info("Is [{}] on CiType[{}] permitted: {}", action, ciTypeId, ciTypePermitted); return ciTypePermitted; }  @Override void authorizeCiData(int ciTypeId, Object ciData, String action); @Override boolean isCiDataPermitted(int ciTypeId, Object ciData, String action); @Cacheable("authorizationService-isCiTypePermitted") @Override boolean isCiTypePermitted(int ciTypeId, String action); @Cacheable("authorizationService-getPermittedData") @Override List<Map<String, Set<?>>> getPermittedData(int ciTypeId, String action); void setSecurityEnabled(boolean securityEnabled);  }