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

com.github.shawven.security.authorization.AuthorizationConfigureProvider Maven / Gradle / Ivy

The newest version!

package com.github.shawven.security.authorization;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;

/**
 * 授权配置提供器,各个模块和业务系统可以通过实现此接口向系统添加授权配置。
 *
 */
public interface AuthorizationConfigureProvider {

    /**
     * 配置授权
     *
     * @param config
     */
    void config(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry config);

    /**
     * 返回的boolean表示配置中是否有针对anyRequest的配置。在整个授权配置中,
     * 应该有且仅有一个针对anyRequest的配置,如果所有的实现都没有针对anyRequest的配置,
     * 系统会自动增加一个anyRequest().authenticated()的配置。如果有多个针对anyRequest
     * 的配置,则会抛出异常。
     *
     * @return
     */
    boolean isAnyRequest();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy