edu.internet2.middleware.grouper.grouperUi.beans.ui.SubjectContainer 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
The newest version!
/*******************************************************************************
* Copyright 2014 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package edu.internet2.middleware.grouper.grouperUi.beans.ui;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import edu.internet2.middleware.grouper.GrouperSession;
import edu.internet2.middleware.grouper.Member;
import edu.internet2.middleware.grouper.MemberFinder;
import edu.internet2.middleware.grouper.authentication.GrouperPasswordSave;
import edu.internet2.middleware.grouper.cfg.GrouperConfig;
import edu.internet2.middleware.grouper.grouperUi.beans.api.GuiAttributeAssign;
import edu.internet2.middleware.grouper.grouperUi.beans.api.GuiGroup;
import edu.internet2.middleware.grouper.grouperUi.beans.api.GuiMembershipSubjectContainer;
import edu.internet2.middleware.grouper.grouperUi.beans.api.GuiSubject;
import edu.internet2.middleware.grouper.grouperUi.beans.json.GuiPaging;
import edu.internet2.middleware.grouper.grouperUi.beans.json.GuiSorting;
import edu.internet2.middleware.grouper.privs.PrivilegeHelper;
import edu.internet2.middleware.grouper.ui.GrouperUiFilter;
import edu.internet2.middleware.grouper.ui.util.GrouperUiConfig;
import edu.internet2.middleware.grouper.ui.util.GrouperUiUserData;
import edu.internet2.middleware.grouper.userData.GrouperUserDataApi;
import edu.internet2.middleware.grouper.util.GrouperUtil;
import edu.internet2.middleware.subject.Source;
import edu.internet2.middleware.subject.Subject;
import edu.internet2.middleware.subject.provider.SourceManager;
/**
*
*/
public class SubjectContainer {
/** logger */
private static final Log LOG = GrouperUtil.getLog(SubjectContainer.class);
/**
* if should show the button for entity privilege
*/
private boolean showEntityPrivilege = false;
/**
* if should show the button for entity privilege
* @return the showEntityPrivilege
*/
public boolean isShowEntityPrivilege() {
return this.showEntityPrivilege;
}
/**
* if should show the button for entity privilege
* @param showEntityPrivilege1 the showEntityPrivilege to set
*/
public void setShowEntityPrivilege(boolean showEntityPrivilege1) {
this.showEntityPrivilege = showEntityPrivilege1;
}
/**
* gui paging for search results when looking for a group to add the subject to
*/
private GuiPaging guiPagingSearchGroupResults;
/**
* if can view privilege inheritance
* @return true if can
*/
public boolean isCanReadPrivilegeInheritance() {
boolean privilegeInheritanceDoesntRequireRulesPrivileges = GrouperUiConfig.retrieveConfig()
.propertyValueBoolean("uiV2.privilegeInheritanceDoesntRequireRulesPrivileges", true);
if (privilegeInheritanceDoesntRequireRulesPrivileges) {
return true;
}
return GrouperRequestContainer.retrieveFromRequestOrCreate().getRulesContainer().isCanReadRules();
}
/**
* gui paging for search results when looking for a group to add the subject to
* @return the paging object
*/
public GuiPaging getGuiPagingSearchGroupResults() {
if (this.guiPagingSearchGroupResults == null) {
this.guiPagingSearchGroupResults = new GuiPaging();
}
return this.guiPagingSearchGroupResults;
}
/**
* gui paging for search results when looking for a group to add the subject to
* @param guiPagingSearchGroupResults1
*/
public void setGuiPagingSearchGroupResults(GuiPaging guiPagingSearchGroupResults1) {
this.guiPagingSearchGroupResults = guiPagingSearchGroupResults1;
}
/**
* search results when looking for a group to add the subject to
*/
private Set guiGroupsAddMember;
/**
* search results when looking for a group to add the subject to
* @return the gui groups
*/
public Set getGuiGroupsAddMember() {
return this.guiGroupsAddMember;
}
/**
* search results when looking for a group to add the subject to
* @param guiGroupsAddMember1
*/
public void setGuiGroupsAddMember(Set guiGroupsAddMember1) {
this.guiGroupsAddMember = guiGroupsAddMember1;
}
/**
* gui subject on the screen
*/
private GuiSubject guiSubject;
/**
* groups that the current user is in
*/
private Set guiMembershipSubjectContainers;
/**
* keep track of the paging on the stem screen
*/
private GuiPaging guiPaging = null;
/**
* if the group is a favorite for the logged in user
*/
private Boolean favorite;
/**
* gui paging for privileges
*/
private GuiPaging privilegeGuiPaging;
/**
* subjects and what privs they have on this stem
*/
private Set privilegeGuiMembershipSubjectContainers;
/**
* gui subject on the screen
* @return the gui subject on the screen
*/
public GuiSubject getGuiSubject() {
return this.guiSubject;
}
/**
* gui subject on the screen
* @param guiSubject1
*/
public void setGuiSubject(GuiSubject guiSubject1) {
this.guiSubject = guiSubject1;
}
/**
* get sources to pick which source
* @return the sources
*/
public Set