Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2012 The Kuali Foundation Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php 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 org.kuali.rice.kim.impl.identity;
 
 
 
 
     private static IdentityService identityService;
     private static PermissionService permissionService;
 
 		throw new UnsupportedOperationException("do not call");
 	}
 
     public static boolean isSuppressName(String entityId) {
         EntityPrivacyPreferences privacy = null;
         EntityDefault entityInfo = getIdentityService().getEntityDefault(entityId);
         if (entityInfo != null) {
             privacy = entityInfo.getPrivacyPreferences();
         } else {
             return true;
         }
         UserSession userSession = GlobalVariables.getUserSession();
 
         boolean suppressName = false;
         if (privacy != null) {
             suppressName = privacy.isSuppressName();
         }
 
         return suppressName
                 && userSession != null
                 && !StringUtils.equals(userSession.getPerson().getEntityId(), entityId)
                 && !canOverrideEntityPrivacyPreferences(entityInfo.getPrincipals().get(0).getPrincipalId());
     }
 
     public static boolean isSuppressEmail(String entityId) {
         EntityPrivacyPreferences privacy = null;
         EntityDefault entityInfo = getIdentityService().getEntityDefault(entityId);
         if (entityInfo != null) {
             privacy = entityInfo.getPrivacyPreferences();
         } else {
             return true;
         }
         UserSession userSession = GlobalVariables.getUserSession();
 
         boolean suppressEmail = false;
         if (privacy != null) {
             suppressEmail = privacy.isSuppressEmail();
         }
         return suppressEmail
                 && userSession != null
                 && !StringUtils.equals(userSession.getPerson().getEntityId(), entityId)
                 && !canOverrideEntityPrivacyPreferences(entityInfo.getPrincipals().get(0).getPrincipalId());
     }
 
     public static boolean isSuppressAddress(String entityId) {
         EntityPrivacyPreferences privacy = null;
         EntityDefault entityInfo = getIdentityService().getEntityDefault(entityId);
         if (entityInfo != null) {
             privacy = entityInfo.getPrivacyPreferences();
         } else {
             return false;
         }
         UserSession userSession = GlobalVariables.getUserSession();
 
         boolean suppressAddress = false;
         if (privacy != null) {
             suppressAddress = privacy.isSuppressAddress();
         }
         return suppressAddress
                 && userSession != null
                 && !StringUtils.equals(userSession.getPerson().getEntityId(), entityId)
                 && !canOverrideEntityPrivacyPreferences(entityInfo.getPrincipals().get(0).getPrincipalId());
     }
 
    public static boolean isSuppressPhone(String entityId) {
        EntityPrivacyPreferences privacy = null;
        EntityDefault entityInfo = getIdentityService().getEntityDefault(entityId);
        if (entityInfo != null) {
            privacy = entityInfo.getPrivacyPreferences();
        } else {
            return true;
        }
        UserSession userSession = GlobalVariables.getUserSession();
        boolean suppressPhone = false;
        if (privacy != null) {
            suppressPhone = privacy.isSuppressPhone();
        }
        return suppressPhone
                && userSession != null
                && !StringUtils.equals(userSession.getPerson().getEntityId(), entityId)
                && !canOverrideEntityPrivacyPreferences(entityInfo.getPrincipals().get(0).getPrincipalId());
    }
    public static boolean isSuppressPersonal(String entityId) {
        EntityPrivacyPreferences privacy = null;
        EntityDefault entityInfo = getIdentityService().getEntityDefault(entityId);
        if (entityInfo != null) {
            privacy = entityInfo.getPrivacyPreferences();
        } else {
            return true;
        }
        UserSession userSession = GlobalVariables.getUserSession();
        boolean suppressPersonal = false;
        if (privacy != null) {
            suppressPersonal = privacy.isSuppressPersonal();
        }
        return suppressPersonal
                && userSession != null
                && !StringUtils.equals(userSession.getPerson().getEntityId(), entityId)
                && !canOverrideEntityPrivacyPreferences(entityInfo.getPrincipals().get(0).getPrincipalId());
    }
    protected static boolean canOverrideEntityPrivacyPreferencesString principalId ){
				GlobalVariables.getUserSession().getPrincipalId(),
	}
    private static IdentityService getIdentityService() {
		if (  == null ) {
			 = KimApiServiceLocator.getIdentityService();
		}
	}
    private static PermissionService getPermissionService() {
		if (  == null ) {
			 = KimApiServiceLocator.getPermissionService();
		}
    }
New to GrepCode? Check out our FAQ X