Skip to content

Commit

Permalink
fix(anonymous user): Only put anonymous user in Redis DB if it's not …
Browse files Browse the repository at this point in the history
…already present (#193)
  • Loading branch information
Travis Tomsu authored Jul 11, 2017
1 parent 616801b commit c97f935
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class UnrestrictedResourceConfig {
@Bean
@ConditionalOnExpression("${fiat.writeMode.enabled:true}")
String addUnrestrictedUser(PermissionsRepository permissionsRepository) {
permissionsRepository.put(new UserPermission().setId(UNRESTRICTED_USERNAME));
if (!permissionsRepository.get(UNRESTRICTED_USERNAME).isPresent()) {
permissionsRepository.put(new UserPermission().setId(UNRESTRICTED_USERNAME));
}
return UNRESTRICTED_USERNAME;
}
}

0 comments on commit c97f935

Please sign in to comment.