package com.inkasso.auth.interfaces;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * @author 张超
 * @date 2021/10/22
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@HasPermission
@Permission
public @interface PermissionAndCheck {

  @AliasFor(
      annotation = HasPermission.class,
      attribute = "value"
  )
  String code() default "";

  @AliasFor(
      annotation = Permission.class,
      attribute = "name"
  )
  String name() default "";

  @AliasFor(
      annotation = Permission.class,
      attribute = "type"
  )
  int type() default 0;

  @AliasFor(
      annotation = HasPermission.class,
      attribute = "roleCode"
  )
  String roleCode() default "";

  @AliasFor(
      annotation = Permission.class,
      attribute = "check"
  )
  boolean check() default true;

}
