@@ -0,0 +1,1955 @@
+package edu.duke.cabig.c3pr.security.vote;%0A%0Aimport edu.duke.cabig.c3pr.accesscontrol.UserPrivilege;%0Aimport edu.duke.cabig.c3pr.utils.SecurityUtils;%0Aimport edu.duke.cabig.c3pr.utils.StringUtils;%0Aimport gov.nih.nci.security.acegi.csm.authorization.CSMObjectIdGenerator;%0Aimport gov.nih.nci.security.acegi.csm.authorization.CSMPrivilegeGenerator;%0A%0Aimport org.acegisecurity.Authentication;%0Aimport org.acegisecurity.ConfigAttribute;%0Aimport org.acegisecurity.ConfigAttributeDefinition;%0Aimport org.acegisecurity.vote.AccessDecisionVoter;%0A%0Apublic class C3PRPrivilegeBasedAccessDecisionVoter implements AccessDecisionVoter%7B%0A%0A%09private String processConfigAttribute;%0A%09%0A%09private CSMPrivilegeGenerator privilegeGenerator;%0A%09%0A%09private CSMObjectIdGenerator objectIdGenerator;%0A%09%0A%09public void setObjectIdGenerator(CSMObjectIdGenerator objectIdGenerator) %7B%0A%09%09this.objectIdGenerator = objectIdGenerator;%0A%09%7D%0A%0A%09public void setPrivilegeGenerator(CSMPrivilegeGenerator privilegeGenerator) %7B%0A%09%09this.privilegeGenerator = privilegeGenerator;%0A%09%7D%0A%0A%09public void setProcessConfigAttribute(String processConfigAttribute) %7B%0A%09%09this.processConfigAttribute = processConfigAttribute;%0A%09%7D%0A%0A%09public boolean supports(ConfigAttribute configattribute) %7B%0A%09%09return configattribute.getAttribute().equals(processConfigAttribute);%0A%09%7D%0A%0A%09public boolean supports(Class class1) %7B%0A%09%09return true;%0A%09%7D%0A%0A%09public int vote(Authentication authentication, Object object,%0A%09%09%09ConfigAttributeDefinition configattributedefinition) %7B%0A%09%09String resolvedPrivilege = privilegeGenerator.generatePrivilege(object);%0A%09%09String resolvedObjectId = objectIdGenerator.generateId(object);%0A%09%09if(!StringUtils.getBlankIfNull(resolvedPrivilege).equals(%22%22) && !StringUtils.getBlankIfNull(resolvedObjectId).equals(%22%22))%7B%0A%09%09%09if(SecurityUtils.hasPrivilege(new UserPrivilege(resolvedObjectId , resolvedPrivilege)))%7B%0A%09%09%09%09return AccessDecisionVoter.ACCESS_GRANTED;%0A%09%09%09%7Delse%7B%0A%09%09%09%09return AccessDecisionVoter.ACCESS_DENIED;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return 0;%0A%09%7D%0A%0A%7D%0A

update the filter check to use the C3PRPrivilegeBasedDecisionVoter. Related to CPR-1846.