mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 08:55:31 +08:00
hotfix: role copy
This commit is contained in:
parent
c05f113abb
commit
efcb801aab
1 changed files with 7 additions and 3 deletions
|
@ -156,10 +156,14 @@ public class RoleService extends BaseService implements AdminGuard {
|
||||||
Application.getSqlExecutor().execute(dsql);
|
Application.getSqlExecutor().execute(dsql);
|
||||||
|
|
||||||
// 2.复制
|
// 2.复制
|
||||||
|
Record base = EntityHelper.forNew(EntityHelper.RolePrivileges, UserContextHolder.getUser());
|
||||||
|
base.setID("roleId", to);
|
||||||
for (Record p : fromPrivileges) {
|
for (Record p : fromPrivileges) {
|
||||||
Record clone = p.clone();
|
Record c = base.clone();
|
||||||
clone.setID("roleId", to);
|
c.setString("definition", p.getString("definition"));
|
||||||
pm.save(clone);
|
c.setInt("entity", p.getInt("entity"));
|
||||||
|
c.setString("zeroKey", p.getString("zeroKey"));
|
||||||
|
pm.save(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.刷新
|
// 3.刷新
|
||||||
|
|
Loading…
Reference in a new issue