mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-29 07:11:38 +08:00
Release version 5.1.0, fix permission not load in real time
This commit is contained in:
parent
7a402bad40
commit
7c5b7bcc39
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user