
commons.box.app.annotation.Sec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-box-app Show documentation
Show all versions of commons-box-app Show documentation
Common utils for BOX projects.
The newest version!
package commons.box.app.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 用于表达权限
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
public @interface Sec {
/**
* 对应的权限要求,允许多个值,通配符使用 *
*
* @return
*/
String[] value() default {};
/**
* 对应角色的要求,允许多个值,通配符使用 *
*
* @return
*/
String[] roles() default {};
/**
* 对应的账户要求,允许多个值,通配符使用 *
*
* @return
*/
String[] account() default {};
/**
* 命名 sec 目标资源路径(方法或者API)
*
* 用于方法拦截器时:当方法或字段的Sec声明了 link 时,方法拦截器将会查找类中同名的Sec并将其作为真实值返回
*
* 用于集中定义时:查找集中定义源中的同名 Sec
*
* @return
*/
String[] path() default {};
/**
* 是否全匹配 全匹配是要求目标符合全部规则
*
* @return
*/
boolean all() default false;
/**
* 是否要求用户信息从 web session 中获取,默认为 false (仅在 pac4j中有效)
*
* @return
*/
boolean session() default false;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy