Search in sources :

Example 1 with DataScopeInterceptor

use of com.albedo.java.plugins.database.mybatis.datascope.DataScopeInterceptor in project albedo by somowhere.

the class AuthorityMybatisAutoConfiguration method getPaginationBeforeInnerInterceptor.

/**
 * 数据权限插件
 *
 * @return 数据权限插件
 */
@Override
protected List<InnerInterceptor> getPaginationBeforeInnerInterceptor() {
    List<InnerInterceptor> list = new ArrayList<>();
    Boolean isDataScope = databaseProperties.getIsDataScope();
    if (isDataScope) {
        list.add(new OptimisticLockerInnerInterceptor());
        list.add(new DataScopeInterceptor());
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) OptimisticLockerInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor) InnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor) OptimisticLockerInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor) DataScopeInterceptor(com.albedo.java.plugins.database.mybatis.datascope.DataScopeInterceptor)

Aggregations

DataScopeInterceptor (com.albedo.java.plugins.database.mybatis.datascope.DataScopeInterceptor)1 InnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor)1 OptimisticLockerInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor)1 ArrayList (java.util.ArrayList)1