edu.internet2.middleware.grouper.grouperUi.beans.ui.ExternalSystemContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grouper-ui Show documentation
Show all versions of grouper-ui Show documentation
Internet2 Groups Management User Interface
package edu.internet2.middleware.grouper.grouperUi.beans.ui;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem;
import edu.internet2.middleware.grouper.privs.PrivilegeHelper;
import edu.internet2.middleware.grouper.ui.GrouperUiFilter;
import edu.internet2.middleware.subject.Subject;
/**
*
*/
public class ExternalSystemContainer {
/**
* grouper external system user is currently viewing/editing/adding
*/
private GuiGrouperExternalSystem guiGrouperExternalSystem;
/**
* all external systems
*/
private List guiGrouperExternalSystems = new ArrayList();
/**
* html for external system
*/
private String html;
public List getGuiGrouperExternalSystems() {
return guiGrouperExternalSystems;
}
public void setGuiGrouperExternalSystems(
List guiGrouperExternalSystems) {
this.guiGrouperExternalSystems = guiGrouperExternalSystems;
}
public GuiGrouperExternalSystem getGuiGrouperExternalSystem() {
return guiGrouperExternalSystem;
}
public void setGuiGrouperExternalSystem(
GuiGrouperExternalSystem guiGrouperExternalSystem) {
this.guiGrouperExternalSystem = guiGrouperExternalSystem;
}
public String getHtml() {
return html;
}
public void setHtml(String html) {
this.html = html;
}
/**
* @return true if can view external systems
*/
public boolean isCanViewExternalSystems() {
Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();
if (PrivilegeHelper.isWheelOrRoot(loggedInSubject)) {
return true;
}
return false;
}
public List getAllExternalSystems() {
return GrouperExternalSystem.retrieveAllGrouperExternalSystems();
}
public List getAllExternalSystemTypes() {
return GrouperExternalSystem.retrieveAllModuleConfigurationTypes();
}
public List getAllExternalSystemTypesAdd() {
List retrieveAllModuleConfigurationTypes = new ArrayList(GrouperExternalSystem.retrieveAllModuleConfigurationTypes());
Iterator iterator = retrieveAllModuleConfigurationTypes.iterator();
while (iterator.hasNext()) {
GrouperExternalSystem grouperExternalSystem = iterator.next();
if (!grouperExternalSystem.isCanAdd()) {
iterator.remove();
}
}
return retrieveAllModuleConfigurationTypes;
}
}