优化数据权限

This commit is contained in:
zhouhao
2019-01-17 16:05:11 +08:00
parent 1f24acb3bf
commit fa546389f8
9 changed files with 235 additions and 91 deletions

View File

@@ -0,0 +1,20 @@
package org.hswebframework.web.authorization.access;
/**
* 和user关联的实体
*
* @author zhouhao
* @since 3.0.6
*/
public interface UserAttachEntity {
String userId = "userId";
String getUserId();
void setUserId(String userId);
default String getUserIdProperty() {
return userId;
}
}

View File

@@ -43,7 +43,6 @@ public @interface RequiresDataAccess {
/**
* @return permission id ,如果为空将继承 {@link Authorize#permission()}
* @see Permission#getId()
*
*/
String permission() default "";
@@ -82,4 +81,9 @@ public @interface RequiresDataAccess {
*/
boolean ignore() default false;
/**
* @return 进行控制的实体类类型
* @since 3.0.6
*/
Class entityType() default Void.class;
}

View File

@@ -4,7 +4,6 @@ package org.hswebframework.web.authorization.define;
import java.io.Serializable;
/**
*
* @author zhouhao
* @see org.hswebframework.web.authorization.annotation.RequiresDataAccess
*/
@@ -14,6 +13,8 @@ public interface DataAccessDefinition extends Serializable {
String getIdParameterName();
Class getEntityType();
Phased getPhased();
}