提交 7c5b7bcc 编写于 作者: Chatopera 研发团队's avatar Chatopera 研发团队

Release version 5.1.0, fix permission not load in real time

上级 7a402bad
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.chatopera.cc</groupId>
<artifactId>contact-center</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
<packaging>war</packaging>
<name>cskefu</name>
<description>春松客服:多渠道智能客服系统</description>
......
......@@ -478,18 +478,20 @@ public class UserProxy {
public Predicate toPredicate(
Root<RoleAuth> root, CriteriaQuery<?> query,
CriteriaBuilder cb) {
List<Predicate> list = new ArrayList<Predicate>();
List<Predicate> criteria = new ArrayList<Predicate>();
if (user.getRoleList() != null && user.getRoleList().size() > 0) {
for (Role role : user.getRoleList()) {
list.add(cb.equal(root.get("roleid").as(String.class), role.getId()));
criteria.add(cb.equal(root.get("roleid").as(String.class), role.getId()));
}
}
Predicate[] p = new Predicate[list.size()];
Predicate[] p = new Predicate[criteria.size()];
cb.and(cb.equal(root.get("orgi").as(String.class), user.getOrgi()));
return cb.or(list.toArray(p));
return cb.or(criteria.toArray(p));
}
});
// clear previous auth map values, ensure the changes are token effect in real time.
user.getRoleAuthMap().clear();
if (roleAuthList != null) {
for (RoleAuth roleAuth : roleAuthList) {
user.getRoleAuthMap().put(roleAuth.getDicvalue(), true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册