|
@@ -2,17 +2,15 @@ package org.hswebframework.web.organizational.authorization.simple.handler;
|
|
|
|
|
|
import org.hswebframework.web.authorization.access.DataAccessConfig;
|
|
import org.hswebframework.web.authorization.access.DataAccessConfig;
|
|
import org.hswebframework.web.authorization.access.DataAccessHandler;
|
|
import org.hswebframework.web.authorization.access.DataAccessHandler;
|
|
-import org.hswebframework.web.authorization.access.ScopeDataAccessConfig;
|
|
|
|
|
|
+import org.hswebframework.web.authorization.define.AuthorizingContext;
|
|
import org.hswebframework.web.boost.aop.context.MethodInterceptorParamContext;
|
|
import org.hswebframework.web.boost.aop.context.MethodInterceptorParamContext;
|
|
import org.hswebframework.web.organizational.authorization.access.DataAccessType;
|
|
import org.hswebframework.web.organizational.authorization.access.DataAccessType;
|
|
-import org.hswebframework.web.organizational.authorization.simple.CustomScope;
|
|
|
|
import org.hswebframework.web.organizational.authorization.simple.SimpleCustomScopeDataAccessConfig;
|
|
import org.hswebframework.web.organizational.authorization.simple.SimpleCustomScopeDataAccessConfig;
|
|
import org.hswebframework.web.organizational.authorization.simple.SimpleScopeDataAccessConfig;
|
|
import org.hswebframework.web.organizational.authorization.simple.SimpleScopeDataAccessConfig;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.HashSet;
|
|
import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Set;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* TODO 完成注释
|
|
* TODO 完成注释
|
|
@@ -22,7 +20,7 @@ import java.util.Set;
|
|
public class CustomScopeHandler implements DataAccessHandler {
|
|
public class CustomScopeHandler implements DataAccessHandler {
|
|
|
|
|
|
private List<DataAccessHandler> handlers = Arrays.asList(
|
|
private List<DataAccessHandler> handlers = Arrays.asList(
|
|
- new AreaScopeDataAccessHandler(),
|
|
|
|
|
|
+ new DistrictScopeDataAccessHandler(),
|
|
new DepartmentScopeDataAccessHandler(),
|
|
new DepartmentScopeDataAccessHandler(),
|
|
new OrgScopeDataAccessHandler(),
|
|
new OrgScopeDataAccessHandler(),
|
|
new PersonScopeDataAccessHandler(),
|
|
new PersonScopeDataAccessHandler(),
|
|
@@ -35,7 +33,7 @@ public class CustomScopeHandler implements DataAccessHandler {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean handle(DataAccessConfig access, MethodInterceptorParamContext context) {
|
|
|
|
|
|
+ public boolean handle(DataAccessConfig access, AuthorizingContext context) {
|
|
return ((SimpleCustomScopeDataAccessConfig) access).getScope()
|
|
return ((SimpleCustomScopeDataAccessConfig) access).getScope()
|
|
.stream()
|
|
.stream()
|
|
.map(scope -> new SimpleScopeDataAccessConfig(scope.getType(), DataAccessType.SCOPE_TYPE_CUSTOM, access.getAction(), new HashSet<>(scope.getIds())))
|
|
.map(scope -> new SimpleScopeDataAccessConfig(scope.getType(), DataAccessType.SCOPE_TYPE_CUSTOM, access.getAction(), new HashSet<>(scope.getIds())))
|