コード例 #1
0
ファイル: UserService.java プロジェクト: rusio/gocd
 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);
 }
コード例 #2
0
ファイル: GoConfigService.java プロジェクト: jyotisingh/gocd
 public void modifyEnvironments(List<AgentInstance> agents, List<TriStateSelection> selections) {
   GoConfigDao.CompositeConfigCommand command = new GoConfigDao.CompositeConfigCommand();
   for (AgentInstance agentInstance : agents) {
     String uuid = agentInstance.getUuid();
     if (hasAgent(uuid)) {
       for (TriStateSelection selection : selections) {
         command.addCommand(
             new ModifyEnvironmentCommand(uuid, selection.getValue(), selection.getAction()));
       }
     }
   }
   updateConfig(command);
 }