Browse Source

角色权限配置,支持清空

test
smallchill 6 years ago
parent
commit
2b07ca45a4
  1. 2
      blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java
  2. 2
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java

2
blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java

@ -57,7 +57,7 @@ public interface IRoleService extends IService<Role> {
* @param apiScopeIds 接口权限id集合 * @param apiScopeIds 接口权限id集合
* @return 是否成功 * @return 是否成功
*/ */
boolean grant(@NotEmpty List<Long> roleIds, @NotEmpty List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds); boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds);
/** /**
* 获取角色名 * 获取角色名

2
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java

@ -75,7 +75,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean grant(@NotEmpty List<Long> roleIds, @NotEmpty List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds) { public boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds) {
// 删除角色配置的菜单集合 // 删除角色配置的菜单集合
roleMenuService.remove(Wrappers.<RoleMenu>update().lambda().in(RoleMenu::getRoleId, roleIds)); roleMenuService.remove(Wrappers.<RoleMenu>update().lambda().in(RoleMenu::getRoleId, roleIds));
// 组装配置 // 组装配置

Loading…
Cancel
Save