| | |
| | | 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 |
| | | @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); |