org.mountcloud.springcloud.common.oauth2feigh.permission.OauthAuthenticatedVoter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-common-oauth-feigh Show documentation
Show all versions of spring-cloud-common-oauth-feigh Show documentation
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.AuthenticatedVoter;
import org.springframework.security.core.Authentication;
/**
* @author zhanghaishan
* @version V1.0
* TODO: AuthenticatedVoter 验证器,添加系统用户验证
* 2020年1月13日.
*/
public class OauthAuthenticatedVoter extends AuthenticatedVoter{
@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