Beispiel #1
0
 public AdminAndRoleSelections getAdminAndRoleSelections(List<String> users) {
   final SecurityConfig securityConfig = goConfigService.security();
   Set<Role> roles = allRoles(securityConfig);
   final List<TriStateSelection> roleSelections = TriStateSelection.forRoles(roles, users);
   final TriStateSelection adminSelection =
       TriStateSelection.forSystemAdmin(
           securityConfig.adminsConfig(),
           roles,
           new SecurityService.UserRoleMatcherImpl(securityConfig),
           users);
   return new AdminAndRoleSelections(adminSelection, roleSelections);
 }
Beispiel #2
0
 private HashSet<Role> allRoles(SecurityConfig security) {
   return new HashSet<Role>(security.getRoles());
 }