hotfix: role copy

This commit is contained in:
RB 2024-04-01 19:32:29 +08:00
parent c05f113abb
commit efcb801aab

View file

@ -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.刷新