Bladeren bron

优化权限,整合在一起

zhouhao 7 jaren geleden
bovenliggende
commit
1074979030

+ 7 - 1
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/annotation/Authorize.java

@@ -36,7 +36,7 @@ import java.lang.annotation.*;
 @Retention(RetentionPolicy.RUNTIME)
 @Inherited
 @Documented
-public @interface Authorize {
+public @interface  Authorize {
 
     /**
      * 对角色授权,当使用按角色授权时,对模块以及操作级别授权方式失效
@@ -95,4 +95,10 @@ public @interface Authorize {
      * @return 是否忽略, 忽略后将不进行权限控制
      */
     boolean ignore() default false;
+
+    /**
+     *
+     * @return 数据权限控制
+     */
+    RequiresDataAccess[] dataAccess()default {};
 }

+ 2 - 0
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/annotation/RequiresDataAccess.java

@@ -31,6 +31,7 @@ import java.lang.annotation.*;
  *
  * @author zhouhao
  * @see DataAccessController
+ * @see Authorize#dataAccess()
  * @since 3.0
  */
 @Target({ElementType.TYPE, ElementType.METHOD})
@@ -41,6 +42,7 @@ public @interface RequiresDataAccess {
     /**
      * @return permission id ,如果为空将继承 {@link Authorize#permission()}
      * @see Permission#getId()
+     *
      */
     String permission() default "";