Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
d5369b34
提交
d5369b34
编写于
5月 13, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
25edf511
变更
23
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
48 行增加
和
123 行删除
+48
-123
config.xml
config.xml
+5
-5
Dockerfile
ibzou-app/ibzou-app-web/src/main/docker/Dockerfile
+1
-1
ibzou-app-web.yaml
ibzou-app/ibzou-app-web/src/main/docker/ibzou-app-web.yaml
+1
-3
webSecurityConfig.java
...rc/main/java/cn/ibizlab/web/config/webSecurityConfig.java
+0
-1
webApplication.java
...-app-web/src/main/java/cn/ibizlab/web/webApplication.java
+1
-0
application-web-dev.yml
.../ibzou-app-web/src/main/resources/application-web-dev.yml
+1
-1
application-web-prod.yml
...ibzou-app-web/src/main/resources/application-web-prod.yml
+5
-5
DevBootApplication.java
ibzou-boot/src/main/java/cn/ibizlab/DevBootApplication.java
+3
-1
application-dev.yml
ibzou-boot/src/main/resources/application-dev.yml
+12
-1
DEPrivs.json
ibzou-core/src/main/resources/deprivs/DEPrivs.json
+0
-21
Dockerfile
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
+1
-1
ibzou-provider-api.yaml
...bzou-provider-api/src/main/docker/ibzou-provider-api.yaml
+3
-1
apiSecurityConfig.java
...rc/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
+0
-1
ibzouapiApplication.java
...api/src/main/java/cn/ibizlab/api/ibzouapiApplication.java
+1
-0
application-api-dev.yml
...u-provider-api/src/main/resources/application-api-dev.yml
+1
-1
application-api-prod.yml
...-provider-api/src/main/resources/application-api-prod.yml
+1
-1
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+1
-1
AuthenticationController.java
...n/java/cn/ibizlab/util/rest/AuthenticationController.java
+2
-1
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+2
-76
AuthorizationTokenFilter.java
...va/cn/ibizlab/util/security/AuthorizationTokenFilter.java
+1
-1
IBZUAAUserService.java
.../main/java/cn/ibizlab/util/service/IBZUAAUserService.java
+2
-0
IBZUSERServiceImpl.java
...main/java/cn/ibizlab/util/service/IBZUSERServiceImpl.java
+2
-0
SimpleUserService.java
.../main/java/cn/ibizlab/util/service/SimpleUserService.java
+2
-0
未找到文件。
config.xml
浏览文件 @
d5369b34
...
@@ -37,11 +37,11 @@
...
@@ -37,11 +37,11 @@
git clone -b master $para2 ibzou/
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
cd ibzou/
mvn clean package -P
web
mvn clean package -P
api
cd ibzou-
app/ibzou-app-web
cd ibzou-
provider/ibzou-provider-api
mvn -P
web
docker:build
mvn -P
api
docker:build
mvn -P
web
docker:push
mvn -P
api
docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-
app-web.yaml ibzlab-rt --with-registry-auth
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-
provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</command>
</hudson.tasks.Shell>
</hudson.tasks.Shell>
</builders>
</builders>
...
...
ibzou-app/ibzou-app-web/src/main/docker/Dockerfile
浏览文件 @
d5369b34
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
EXPOSE
30001
EXPOSE
8080
ADD
ibzou-app-web.jar /ibzou-app-web.jar
ADD
ibzou-app-web.jar /ibzou-app-web.jar
ibzou-app/ibzou-app-web/src/main/docker/ibzou-app-web.yaml
浏览文件 @
d5369b34
...
@@ -3,11 +3,9 @@ services:
...
@@ -3,11 +3,9 @@ services:
ibzou-app-web
:
ibzou-app-web
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-app-web:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-app-web:latest
ports
:
ports
:
-
"
30001:30001
"
-
"
8080:8080
"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
:
172.16.180.237
deploy
:
deploy
:
mode
:
replicated
mode
:
replicated
replicas
:
1
replicas
:
1
...
...
ibzou-app/ibzou-app-web/src/main/java/cn/ibizlab/web/config/webSecurityConfig.java
浏览文件 @
d5369b34
...
@@ -31,7 +31,6 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -31,7 +31,6 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
private
AuthenticationEntryPoint
unauthorizedHandler
;
private
AuthenticationEntryPoint
unauthorizedHandler
;
@Autowired
@Autowired
@Qualifier
(
"IBZUAAUserService"
)
private
AuthenticationUserService
userDetailsService
;
private
AuthenticationUserService
userDetailsService
;
/**
/**
...
...
ibzou-app/ibzou-app-web/src/main/java/cn/ibizlab/web/webApplication.java
浏览文件 @
d5369b34
...
@@ -27,6 +27,7 @@ import java.util.List;
...
@@ -27,6 +27,7 @@ import java.util.List;
@MapperScan
(
"cn.ibizlab.*.mapper"
)
@MapperScan
(
"cn.ibizlab.*.mapper"
)
@SpringBootApplication
(
exclude
=
{
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
MongoAutoConfiguration
.
class
,
})
})
public
class
webApplication
extends
WebMvcConfigurerAdapter
{
public
class
webApplication
extends
WebMvcConfigurerAdapter
{
...
...
ibzou-app/ibzou-app-web/src/main/resources/application-web-dev.yml
浏览文件 @
d5369b34
server
:
server
:
port
:
30001
port
:
8080
\ No newline at end of file
\ No newline at end of file
ibzou-app/ibzou-app-web/src/main/resources/application-web-prod.yml
浏览文件 @
d5369b34
server
:
server
:
port
:
30001
port
:
8080
#zuul网关路由设置
#zuul网关路由设置
zuul
:
zuul
:
...
@@ -16,9 +16,9 @@ zuul:
...
@@ -16,9 +16,9 @@ zuul:
path
:
/ibzorganizations/**
path
:
/ibzorganizations/**
serviceId
:
ibzou-api
serviceId
:
ibzou-api
stripPrefix
:
false
stripPrefix
:
false
wfcore
:
loginv7
:
path
:
/
wfcore/**
path
:
/
v7/login
serviceId
:
ibz
wf
-api
serviceId
:
ibz
uaa
-api
stripPrefix
:
tru
e
stripPrefix
:
fals
e
sensitive-headers
:
sensitive-headers
:
-
Cookie,Set-Cookie,Authorization
-
Cookie,Set-Cookie,Authorization
ibzou-boot/src/main/java/cn/ibizlab/DevBootApplication.java
浏览文件 @
d5369b34
...
@@ -15,8 +15,10 @@ import java.util.List;
...
@@ -15,8 +15,10 @@ import java.util.List;
@EnableDiscoveryClient
@EnableDiscoveryClient
@Configuration
@Configuration
@EnableTransactionManagement
@EnableTransactionManagement
@SpringBootApplication
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
MongoAutoConfiguration
.
class
,
})
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
ibzou-boot/src/main/resources/application-dev.yml
浏览文件 @
d5369b34
server
:
server
:
port
:
8080
port
:
40001
#zuul网关路由设置
zuul
:
routes
:
loginv7
:
path
:
/v7/login
serviceId
:
ibzuaa-api
stripPrefix
:
false
sensitive-headers
:
-
Cookie,Set-Cookie,Authorization
ibzou-core/src/main/resources/deprivs/DEPrivs.json
浏览文件 @
d5369b34
...
@@ -3,27 +3,6 @@
...
@@ -3,27 +3,6 @@
],
],
"predefineddatarange"
:[{
"id"
:
"ALL"
,
"name"
:
"全部数据"
},{
"id"
:
"CURORG"
,
"name"
:
"当前单位"
},{
"id"
:
"PORG"
,
"name"
:
"上级单位"
},{
"id"
:
"SORG"
,
"name"
:
"下级单位"
},{
"id"
:
"CURORGDEPT"
,
"name"
:
"当前部门"
},{
"id"
:
"PORGDEPT"
,
"name"
:
"上级部门"
},{
"id"
:
"SORGDEPT"
,
"name"
:
"下级部门"
}],
"predefineddatarange"
:[{
"id"
:
"ALL"
,
"name"
:
"全部数据"
},{
"id"
:
"CURORG"
,
"name"
:
"当前单位"
},{
"id"
:
"PORG"
,
"name"
:
"上级单位"
},{
"id"
:
"SORG"
,
"name"
:
"下级单位"
},{
"id"
:
"CURORGDEPT"
,
"name"
:
"当前部门"
},{
"id"
:
"PORGDEPT"
,
"name"
:
"上级部门"
},{
"id"
:
"SORGDEPT"
,
"name"
:
"下级部门"
}],
"entities"
:[
"entities"
:[
{
"dename"
:
"IBZDepartment"
,
"delogicname"
:
"部门"
,
"sysmoudle"
:{
"id"
:
"OU"
,
"name"
:
"ou"
},
"dedataset"
:[{
"id"
:
"CurDept"
,
"name"
:
"CurDept"
},{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
}]
}
,
{
"dename"
:
"IBZEmployee"
,
"delogicname"
:
"人员"
,
"sysmoudle"
:{
"id"
:
"OU"
,
"name"
:
"ou"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"InitPwd"
,
"name"
:
"初始化密码"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
}]
}
,
{
"dename"
:
"IBZOrganization"
,
"delogicname"
:
"单位机构"
,
"sysmoudle"
:{
"id"
:
"OU"
,
"name"
:
"ou"
},
"dedataset"
:[{
"id"
:
"SelectSOrg"
,
"name"
:
"查询下级单位"
},{
"id"
:
"SelectPOrg"
,
"name"
:
"查询上级单位"
},{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
}]
}
]
]
}
}
ibzou-provider/ibzou-provider-api/src/main/docker/Dockerfile
浏览文件 @
d5369b34
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
EXPOSE
808
1
EXPOSE
4000
1
ADD
ibzou-provider-api.jar /ibzou-provider-api.jar
ADD
ibzou-provider-api.jar /ibzou-provider-api.jar
ibzou-provider/ibzou-provider-api/src/main/docker/ibzou-provider-api.yaml
浏览文件 @
d5369b34
...
@@ -3,9 +3,11 @@ services:
...
@@ -3,9 +3,11 @@ services:
ibzou-provider-api
:
ibzou-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports
:
ports
:
-
"
8081:808
1"
-
"
40001:4000
1"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
:
172.16.180.237
deploy
:
deploy
:
mode
:
replicated
mode
:
replicated
replicas
:
1
replicas
:
1
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
浏览文件 @
d5369b34
...
@@ -31,7 +31,6 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -31,7 +31,6 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
private
AuthenticationEntryPoint
unauthorizedHandler
;
private
AuthenticationEntryPoint
unauthorizedHandler
;
@Autowired
@Autowired
@Qualifier
(
"IBZUAAUserService"
)
private
AuthenticationUserService
userDetailsService
;
private
AuthenticationUserService
userDetailsService
;
/**
/**
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/ibzouapiApplication.java
浏览文件 @
d5369b34
...
@@ -23,6 +23,7 @@ import java.util.List;
...
@@ -23,6 +23,7 @@ import java.util.List;
@MapperScan
(
"cn.ibizlab.*.mapper"
)
@MapperScan
(
"cn.ibizlab.*.mapper"
)
@SpringBootApplication
(
exclude
=
{
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
MongoAutoConfiguration
.
class
,
})
})
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
public
class
ibzouapiApplication
extends
WebMvcConfigurerAdapter
{
public
class
ibzouapiApplication
extends
WebMvcConfigurerAdapter
{
...
...
ibzou-provider/ibzou-provider-api/src/main/resources/application-api-dev.yml
浏览文件 @
d5369b34
server
:
server
:
port
:
8081
port
:
40001
\ No newline at end of file
\ No newline at end of file
ibzou-provider/ibzou-provider-api/src/main/resources/application-api-prod.yml
浏览文件 @
d5369b34
server
:
server
:
port
:
808
1
port
:
4000
1
ibzou-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
d5369b34
...
@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
...
@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value
(
"${ibiz.enablePermissionValid:false}"
)
@Value
(
"${ibiz.enablePermissionValid:false}"
)
boolean
enablePermissionValid
;
//是否开启权限校验
boolean
enablePermissionValid
;
//是否开启权限校验
@Value
(
"${ibiz.systemid:
110B1A3E-4944-47C8-B4C4-EC15FB8982F3
}"
)
@Value
(
"${ibiz.systemid:
ibzou
}"
)
private
String
systemId
;
private
String
systemId
;
@Override
@Override
...
...
ibzou-util/src/main/java/cn/ibizlab/util/rest/AuthenticationController.java
浏览文件 @
d5369b34
...
@@ -15,9 +15,11 @@ import org.springframework.security.core.userdetails.UserDetails;
...
@@ -15,9 +15,11 @@ import org.springframework.security.core.userdetails.UserDetails;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
@RestController
@RestController
@RequestMapping
(
"/"
)
@RequestMapping
(
"/"
)
@ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"false"
)
public
class
AuthenticationController
public
class
AuthenticationController
{
{
...
@@ -28,7 +30,6 @@ public class AuthenticationController
...
@@ -28,7 +30,6 @@ public class AuthenticationController
private
AuthTokenUtil
jwtTokenUtil
;
private
AuthTokenUtil
jwtTokenUtil
;
@Autowired
@Autowired
@Qualifier
(
"IBZUAAUserService"
)
private
AuthenticationUserService
userDetailsService
;
private
AuthenticationUserService
userDetailsService
;
@PostMapping
(
value
=
"${ibiz.auth.path:v7/login}"
)
@PostMapping
(
value
=
"${ibiz.auth.path:v7/login}"
)
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
d5369b34
...
@@ -12,6 +12,7 @@ import cn.ibizlab.util.filter.QueryBuildContext;
...
@@ -12,6 +12,7 @@ import cn.ibizlab.util.filter.QueryBuildContext;
import
cn.ibizlab.util.filter.QueryWrapperContext
;
import
cn.ibizlab.util.filter.QueryWrapperContext
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
...
@@ -48,6 +49,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -48,6 +49,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
private
String
keyFieldTag
=
"keyfield"
;
private
String
keyFieldTag
=
"keyfield"
;
@Resource
@Resource
@Lazy
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
/**
/**
...
@@ -115,8 +117,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -115,8 +117,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if
(!
validDataSetHasPermission
(
permissionList
,
entityName
,
dataSetName
)){
if
(!
validDataSetHasPermission
(
permissionList
,
entityName
,
dataSetName
)){
return
false
;
return
false
;
}
}
//拼接权限条件
deDataSetFillPermissionSQLRouter
(
deStorageMode
,
searchContext
,
entity
,
dataSetName
,
permissionList
);
}
}
return
true
;
return
true
;
}
}
...
@@ -344,80 +344,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -344,80 +344,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
}
}
/**
* 根据实体存储类型,拼接权限条件
* @param deStorageMode
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private
void
deDataSetFillPermissionSQLRouter
(
String
deStorageMode
,
Object
searchContext
,
EntityBase
entity
,
String
dataSetName
,
JSONObject
permissionList
){
//检查是否有数据权限[单行删除]
if
(
deStorageMode
.
equalsIgnoreCase
(
"sql"
)){
sqlPermissionBuilder
(
searchContext
,
entity
,
dataSetName
,
permissionList
);
}
else
if
(
deStorageMode
.
equalsIgnoreCase
(
"nosql"
)){
noSqlPermissionBuilder
(
searchContext
,
entity
,
dataSetName
,
permissionList
);
}
else
if
(
deStorageMode
.
equalsIgnoreCase
(
"serviceapi"
)){
}
else
{
throw
new
RuntimeException
(
String
.
format
(
"未能识别[%s]实体对应存储模式[%s]"
,
entity
.
getClass
().
getSimpleName
(),
deStorageMode
));
}
}
/**
* 为NoSQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private
void
noSqlPermissionBuilder
(
Object
searchContext
,
EntityBase
entity
,
String
dataSetName
,
JSONObject
permissionList
)
{
if
(
searchContext
instanceof
QueryBuildContext
){
//获取权限表达式[全部数据、本单位、本部门等]
String
entityName
=
entity
.
getClass
().
getSimpleName
();
JSONObject
entityObj
=
permissionList
.
getJSONObject
(
entityName
);
JSONObject
permissionType
=
entityObj
.
getJSONObject
(
DataSetTag
);
JSONArray
dataRange
=
permissionType
.
getJSONArray
(
dataSetName
);
if
(
dataRange
.
size
()==
0
)
return
;
//根据权限表达式生成查询条件,并将查询条件设置到SearchContext中
fillNoSqlPermissionCond
(
dataRange
,
entity
,((
QueryBuildContext
)
searchContext
).
getSelectCond
());
}
}
/**
* 为SQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private
void
sqlPermissionBuilder
(
Object
searchContext
,
EntityBase
entity
,
String
dataSetName
,
JSONObject
permissionList
){
//获取权限表达式[全部数据、本单位、本部门等]
String
entityName
=
entity
.
getClass
().
getSimpleName
();
JSONObject
entityObj
=
permissionList
.
getJSONObject
(
entityName
);
//获取实体
JSONObject
permissionType
=
entityObj
.
getJSONObject
(
DataSetTag
);
JSONArray
dataRange
=
permissionType
.
getJSONArray
(
dataSetName
);
//获取实体数据集
if
(
dataRange
.
size
()==
0
)
return
;
//根据权限条件获取SQL
String
permissionSQL
=
getPermissionSQL
(
entity
,
dataRange
);
//将SQL拼接到SearchContext中
if
(
searchContext
instanceof
QueryWrapperContext
){
QueryWrapperContext
queryWrapperContext
=
(
QueryWrapperContext
)
searchContext
;
QueryWrapper
queryWrapper
=
queryWrapperContext
.
getSelectCond
();
queryWrapper
.
apply
(
permissionSQL
);
}
}
/**
/**
* 为NoSQL存储模式的表格查询填充权限条件
* 为NoSQL存储模式的表格查询填充权限条件
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthorizationTokenFilter.java
浏览文件 @
d5369b34
...
@@ -27,7 +27,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
...
@@ -27,7 +27,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private
final
AuthTokenUtil
authTokenUtil
;
private
final
AuthTokenUtil
authTokenUtil
;
private
final
String
tokenHeader
;
private
final
String
tokenHeader
;
public
AuthorizationTokenFilter
(
@Qualifier
(
"IBZUAAUserService"
)
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@Value
(
"${ibiz.jwt.header:Authorization}"
)
String
tokenHeader
)
{
public
AuthorizationTokenFilter
(
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@Value
(
"${ibiz.jwt.header:Authorization}"
)
String
tokenHeader
)
{
this
.
userDetailsService
=
userDetailsService
;
this
.
userDetailsService
=
userDetailsService
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
tokenHeader
=
tokenHeader
;
this
.
tokenHeader
=
tokenHeader
;
...
...
ibzou-util/src/main/java/cn/ibizlab/util/service/IBZUAAUserService.java
浏览文件 @
d5369b34
...
@@ -12,11 +12,13 @@ import org.springframework.context.annotation.Primary;
...
@@ -12,11 +12,13 @@ import org.springframework.context.annotation.Primary;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
/**
/**
* 实体[IBZUSER] 服务对象接口实现
* 实体[IBZUSER] 服务对象接口实现
*/
*/
@Service
(
"IBZUAAUserService"
)
@Service
(
"IBZUAAUserService"
)
@ConditionalOnExpression
(
"${ibiz.enablePermissionValid:false}||'${ibiz.auth.service:SimpleUserService}'.equals('IBZUAAUserService')"
)
public
class
IBZUAAUserService
implements
AuthenticationUserService
{
public
class
IBZUAAUserService
implements
AuthenticationUserService
{
@Autowired
@Autowired
...
...
ibzou-util/src/main/java/cn/ibizlab/util/service/IBZUSERServiceImpl.java
浏览文件 @
d5369b34
...
@@ -13,11 +13,13 @@ import cn.ibizlab.util.mapper.IBZUSERMapper;
...
@@ -13,11 +13,13 @@ import cn.ibizlab.util.mapper.IBZUSERMapper;
import
cn.ibizlab.util.domain.IBZUSER
;
import
cn.ibizlab.util.domain.IBZUSER
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
/**
/**
* 实体[IBZUSER] 服务对象接口实现
* 实体[IBZUSER] 服务对象接口实现
*/
*/
@Service
(
"IBZUSERService"
)
@Service
(
"IBZUSERService"
)
@ConditionalOnExpression
(
"(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('IBZUSERService')"
)
public
class
IBZUSERServiceImpl
extends
ServiceImpl
<
IBZUSERMapper
,
IBZUSER
>
implements
IBZUSERService
,
AuthenticationUserService
{
public
class
IBZUSERServiceImpl
extends
ServiceImpl
<
IBZUSERMapper
,
IBZUSER
>
implements
IBZUSERService
,
AuthenticationUserService
{
@Value
(
"${ibiz.auth.pwencrymode:0}"
)
@Value
(
"${ibiz.auth.pwencrymode:0}"
)
...
...
ibzou-util/src/main/java/cn/ibizlab/util/service/SimpleUserService.java
浏览文件 @
d5369b34
...
@@ -11,12 +11,14 @@ import org.springframework.util.StringUtils;
...
@@ -11,12 +11,14 @@ import org.springframework.util.StringUtils;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
/**
/**
* 实体[IBZUSER] 服务对象接口实现
* 实体[IBZUSER] 服务对象接口实现
*/
*/
@Primary
@Primary
@Service
(
"SimpleUserService"
)
@Service
(
"SimpleUserService"
)
@ConditionalOnExpression
(
"(!${ibiz.enablePermissionValid:false})&&'${ibiz.auth.service:SimpleUserService}'.equals('SimpleUserService')"
)
public
class
SimpleUserService
implements
AuthenticationUserService
{
public
class
SimpleUserService
implements
AuthenticationUserService
{
@Override
@Override
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录