mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-06 21:30:18 +08:00
@@ -10,6 +10,7 @@ import org.hswebframework.web.api.crud.entity.QueryOperation;
|
||||
import org.hswebframework.web.api.crud.entity.QueryParamEntity;
|
||||
import org.hswebframework.web.authorization.Authentication;
|
||||
import org.hswebframework.web.authorization.annotation.*;
|
||||
import org.hswebframework.web.authorization.exception.UnAuthorizedException;
|
||||
import org.hswebframework.web.crud.service.ReactiveCrudService;
|
||||
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
|
||||
import org.hswebframework.web.system.authorization.api.entity.PermissionEntity;
|
||||
@@ -59,11 +60,12 @@ public class WebFluxPermissionController implements ReactiveServiceCrudControlle
|
||||
}
|
||||
|
||||
@GetMapping("/_query/for-grant")
|
||||
@ResourceAction(id = "grant", name = "赋权")
|
||||
@QueryNoPagingOperation(summary = "获取用于赋权的权限列表")
|
||||
@Authorize(ignore = true)
|
||||
@QueryNoPagingOperation(summary = "获取当前用户用于赋权的权限列表")
|
||||
public Flux<PermissionEntity> queryForGrant(QueryParamEntity query) {
|
||||
return Authentication
|
||||
.currentReactive()
|
||||
.switchIfEmpty(Mono.error(UnAuthorizedException::new))
|
||||
.flatMapMany(auth -> permissionProperties
|
||||
.getFilter()
|
||||
.doFilter(permissionService.query(query.noPaging()), auth));
|
||||
|
||||
Reference in New Issue
Block a user