@Override
	public int vote(UserDetails userDetails, Object object, Collection<GrantedPrivilege> grantedPrivileges, PrivilegesRelation relation) {
		if(null == grantedPrivileges) {
			return AccessDecisionVoter.ACCESS_GRANTED; // 通过
		}
		Collection<GrantedPrivilege> privileges = userDetails.getAllPrivileges();
		switch (relation) {
			case ALL:
				if(privileges.containsAll(grantedPrivileges)) {
					return AccessDecisionVoter.ACCESS_GRANTED; // 通过
				} else {
					return AccessDecisionVoter.ACCESS_DENIED; // 不通过
				}
			case ANY:
				for(GrantedPrivilege p : grantedPrivileges) {
					if(privileges.contains(p)) {
						return AccessDecisionVoter.ACCESS_GRANTED; // 通过
					} 
				}
				return AccessDecisionVoter.ACCESS_DENIED; // 不通过
			case NOT:
				for(GrantedPrivilege p : grantedPrivileges) {
					if(privileges.contains(p)) {
						return AccessDecisionVoter.ACCESS_DENIED; // 不通过
					} 
				}
				return AccessDecisionVoter.ACCESS_GRANTED; // 通过
			default:
				return AccessDecisionVoter.ACCESS_DENIED; // 不通过
		}
	}