| | |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | | import org.springblade.core.tool.utils.CollectionUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<RoleVO> treeByParentId(String parentId) { |
| | | if (AuthUtil.isAdministrator() || AuthUtil.isAdmin()) { |
| | | return ForestNodeMerger.merge(baseMapper.tree(null, RoleConstant.ADMINISTRATOR)); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentId(parentId.split(","))); |
| | | } |
| | | @Override |
| | | public List<RoleVO> treeByParentIdNew(String parentId) { |
| | | |
| | | return ForestNodeMerger.merge(baseMapper.treeByParentIdNew(parentId.split(","))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds) { |
| | | return grantRoleMenu(roleIds, menuIds) && grantDataScope(roleIds, dataScopeIds) && grantApiScope(roleIds, apiScopeIds); |
| | |
| | | // 新增配置 |
| | | roleMenuService.saveBatch(roleMenus); |
| | | // 递归设置下属角色菜单集合 |
| | | recursionRoleMenu(roleIds, menuIds); |
| | | // recursionRoleMenu(roleIds, menuIds); |
| | | return true; |
| | | } |
| | | |