/** * Return true if the following parameter values would allow a subject to * copy the specified stem to another location. * @param stem * @param canCopy This is false if there's a security group limiting the subjects * that can copy stems and this subject is not in the group. * @return boolean */ public static boolean canCopyStem(Stem stem, boolean canCopy) { if (!canCopy || stem.isRootStem()) { return false; } return true; }
/** * Returns true if the following parameter values would allow a subject to * move the specified stem to another location. * @param stem * @param canMove This is false if there's a security group limiting the subjects * that can move stems and this subject is not in the group. * @param privs The naming privileges that the subject has on the stem. * @return boolean */ public static boolean canMoveStem(Stem stem, boolean canMove, Set<Privilege> privs) { if (!canMove || stem.isRootStem()) { return false; } if (privs.contains(NamingPrivilege.STEM_ADMIN)) { return true; } return false; }
/** * Returns true if the following parameters would allow a subject to * move a group to the specified stem. * @param stem * @param privs The naming privileges that the subject has on the stem. * @return boolean */ public static boolean canMoveGroupToStem(Stem stem, Set<Privilege> privs) { if (stem.isRootStem()) { return false; } if (privs.contains(NamingPrivilege.CREATE)) { return true; } return false; }
/** * Returns true if the following parameters would allow a subject to * copy a group to the specified stem. * @param stem * @param privs The naming privileges that the subject has on the stem. * @return boolean */ public static boolean canCopyGroupToStem(Stem stem, Set<Privilege> privs) { if (stem.isRootStem()) { return false; } if (privs.contains(NamingPrivilege.CREATE)) { return true; } return false; }
/** * */ @Override public String retrieveLabel(GrouperSession grouperSession, Stem t) { String displayName = t.isRootStem() ? TextContainer.retrieveFromRequest().getText().get("stem.root.display-name") : t.getDisplayName(); return displayName; }
/** * get the display extension or the special root label * @return the display extension */ public String getGuiDisplayExtension() { if (this.stem == null) { return TextContainer.retrieveFromRequest().getText().get("error.title"); } if (this.stem.isRootStem()) { return TextContainer.retrieveFromRequest().getText().get("stem.root.display-name"); } return this.stem.getDisplayExtension(); }
/** * */ @Override public String retrieveHtmlLabel(GrouperSession grouperSession, Stem t) { //description could be null? String displayName = t.isRootStem() ? TextContainer.retrieveFromRequest().getText().get("stem.root.display-name") : t.getDisplayName(); String label = GrouperUiUtils.escapeHtml(displayName, true); String htmlLabel = "<img src=\"../../grouperExternal/public/assets/images/folder.gif\" /> " + label; return htmlLabel; } // MCH 2014: dont validate here, it messes up other uses
if (grouperObject instanceof Stem && ((Stem)grouperObject).isRootStem()) { result.append("<li class=\"active\">").append(TextContainer.retrieveFromRequest().getText().get("stem.root.display-name")).append("</li>"); } else {
if (parentStem.isRootStem() && ((Stem) stem).isRootStem()) { return false; if (parentStem.isRootStem()) { return true; } else {
if(stem.isRootStem()) privs.remove("create");
if (parentFolder.isRootStem()) {
stem = new StemSave(grouperSession).assignName(parentFolder.isRootStem() ? extension : (parentFolder.getName() + ":" + extension)) .assignDisplayExtension(displayExtension).assignDescription(description).save();
.assignName(stem.getParentStem().isRootStem() ? extension : (stem.getParentStemName() + ":" + extension)) .assignDisplayExtension(displayExtension)
if (parentFolder.isRootStem()) {
.assignParentStemId(stem.getId()).assignStemScope(Scope.ONE).findAttributeNames(); String displayExtension = stem.isRootStem() ? TextContainer.retrieveFromRequest().getText().get("stem.root.display-name") : stem.getDisplayExtension(); String id = stem.isRootStem() ? "root" : stem.getUuid();