All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mountcloud.springcloud.common.oauth2feigh.permission.OauthRoleVoter Maven / Gradle / Ivy

Go to download

This project encapsulates the necessary functions of the oauth resource service, and encapsulates the oauth function of the weight client.

The newest version!
/**
 * 
 */
package org.mountcloud.springcloud.common.oauth2feigh.permission;

import java.util.Collection;

import org.mountcloud.springcloud.common.oauth2feigh.util.SecurityUtil;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.vote.RoleVoter;
import org.springframework.security.core.Authentication;

/**
 * @author zhanghaishan
 * @version V1.0
 * org.mountcloud.mvc.common.oauth2feigh.permission
 * TODO: PreInvocationAuthorizationAdviceVoter验证器添加系统用户验证
 * 2020年1月13日.
 */
public class OauthRoleVoter extends RoleVoter{
	
	
	@Override
	public int vote(Authentication authentication, Object object, Collection attributes) {
		//系统权限级别最高
		if(SecurityUtil.isSystemUser()) {
			return ACCESS_GRANTED;
		}
		return super.vote(authentication, object, attributes);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy