Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Bandener <[email protected]>
  • Loading branch information
nibix committed Jun 20, 2024
1 parent dbf7cd6 commit d128425
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,15 @@ public PrivilegesEvaluator(
SecurityDynamicConfiguration<?> rolesConfiguration = configurationRepository.getConfiguration(CType.ROLES);

if (rolesConfiguration != null) {
FlattenedActionGroups flattenedActionGroups = actionGroupsConfiguration != null
? new FlattenedActionGroups(
(SecurityDynamicConfiguration<ActionGroupsV7>) DynamicConfigFactory.addStatics(
actionGroupsConfiguration.deepClone()
)
@SuppressWarnings("unchecked")
SecurityDynamicConfiguration<ActionGroupsV7> actionGroupsWithStatics = actionGroupsConfiguration != null
? (SecurityDynamicConfiguration<ActionGroupsV7>) DynamicConfigFactory.addStatics(
actionGroupsConfiguration.deepClone()
)
: FlattenedActionGroups.EMPTY;
: (SecurityDynamicConfiguration<ActionGroupsV7>) DynamicConfigFactory.addStatics(
SecurityDynamicConfiguration.empty()
);
FlattenedActionGroups flattenedActionGroups = new FlattenedActionGroups(actionGroupsWithStatics);
ActionPrivileges actionPrivileges = new ActionPrivileges(
DynamicConfigFactory.addStatics(rolesConfiguration.deepClone()),
flattenedActionGroups,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,6 @@ public static <T> SecurityDynamicConfiguration<T> fromYaml(String yaml, CType ct
return result;
}

/**
* For testing only
*/
public static <T> SecurityDynamicConfiguration<T> fromMap(Map<String, Object> map, CType ctype) throws JsonProcessingException {
Class<?> implementationClass = ctype.getImplementationClass().get(2);
SecurityDynamicConfiguration<T> result = DefaultObjectMapper.objectMapper.convertValue(
map,
DefaultObjectMapper.getTypeFactory().constructParametricType(SecurityDynamicConfiguration.class, implementationClass)
);
result.ctype = ctype;
return result;
}

// for Jackson
private SecurityDynamicConfiguration() {
super();
Expand Down

0 comments on commit d128425

Please sign in to comment.