Skip to content

Commit

Permalink
anonymous group
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav-b-7 committed Mar 23, 2022
1 parent 307f3ca commit 1c0078b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class OesPermissionService extends PermissionService{
@Autowired
OesAuthorizationService oesAuthorizationService

static final String defaultGroup = "anonymous"

@Override
void loginWithRoles(String userId, Collection<String> roles) {
if (fiatStatus.isEnabled()) {
Expand All @@ -36,9 +38,15 @@ class OesPermissionService extends PermissionService{
}
if (isOesAuthorizationServiceEnabled){
try {
if (roles == null){
roles = new ArrayList<>()
roles.add(defaultGroup)
} else if (!roles.isEmpty()){
roles.add(defaultGroup)
}
oesAuthorizationService.cacheUserGroups(roles, userId)
} catch(Exception e1){
log.error("Exception occured while login with roles : {}", e1)
log.error("Exception occurred while login with roles : {}", e1)
}
}
}
Expand Down

0 comments on commit 1c0078b

Please sign in to comment.