Skip to content

Commit

Permalink
SHIBUI-2023
Browse files Browse the repository at this point in the history
Adding regex field to Groups
  • Loading branch information
chasegawa committed Aug 16, 2021
1 parent c7a3d36 commit 8606671
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.internet2.tier.shibboleth.admin.ui.configuration.auto;

import edu.internet2.tier.shibboleth.admin.ui.exception.EntityNotFoundException;
import edu.internet2.tier.shibboleth.admin.ui.security.exception.InvalidGroupRegexException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
Expand All @@ -14,6 +16,8 @@
import edu.internet2.tier.shibboleth.admin.ui.security.service.IGroupService;
import edu.internet2.tier.shibboleth.admin.ui.security.service.UserService;

import java.util.List;

/**
* After the context loads, do any needed migration tasks
*/
Expand Down Expand Up @@ -62,6 +66,17 @@ private void doshibui_1740_migration() {
userService.save(user); // this will ensure group is set as the default user group
}
});


// SHIBUI-1743: Adding regex expression to groups
groupService.findAll().forEach(g -> {
g.setValidationRegex(Group.DEFAULT_REGEX);
try {
groupService.updateGroup(g);
}
catch (Exception e) {
// Shouldn't happen
e.printStackTrace();
}
});
}
}
}

0 comments on commit 8606671

Please sign in to comment.