/** Return TRUE if privacy set to visible, FALSE if set to hidden */ public boolean isShow() { if (isMyWorkspace()) { return privacyManager.isViewable(curSite, getUserId()); } else { return privacyManager.isViewable(getContextId(), getUserId()); } }
public Boolean getDisplayPopup() { if (!isMyWorkspace()) { curSite = getContextId(); } // Display popup for when user has not made a selection AND system default is hidden if (displayPopup == null) { Boolean userMadeSelection = false; Boolean currentStatus = false; userMadeSelection = privacyManager.userMadeSelection(curSite, getUserId()); currentStatus = privacyManager.isViewable(curSite, getUserId()); displayPopup = (userMadeSelection || currentStatus ? false : true); } return displayPopup; }
/** Returns 'visible' or 'hidden' based on status within site */ public String getCurrentStatus() { if (!isMyWorkspace()) { curSite = getContextId(); } if (privacyManager.isViewable(curSite, getUserId())) { return VISIBLE; // getMessageBundleString(VISIBLE); } else { return HIDDEN; // getMessageBundleString(HIDDEN); } }
/** Returns text currently displayed on checkbox */ public String getCheckboxText() { if (!isMyWorkspace()) { curSite = getContextId(); } if (privacyManager.isViewable(curSite, getUserId())) { checkboxText = getMessageBundleString(HIDE); } else { checkboxText = getMessageBundleString(SHOW); } return checkboxText; }
/** Does the actual setting of the privacy status */ private void processChoice(String contextId, Boolean status) { privacyManager.setViewableState( contextId, getUserId(), status, privacyManager.USER_RECORD_TYPE); }