Browse Source

增加获取指定人员权限的信息

zhouhao 6 years ago
parent
commit
f4b0f02fa3

+ 13 - 5
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-web/src/main/java/org/hswebframework/web/controller/organizational/PersonController.java

@@ -1,18 +1,18 @@
 /*
  *  Copyright 2016 http://www.hswebframework.org
- *  
+ *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
  *        http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
- *  
+ *
  */
 
 package org.hswebframework.web.controller.organizational;
@@ -30,6 +30,7 @@ import org.hswebframework.web.controller.message.ResponseMessage;
 import org.hswebframework.web.entity.organizational.PersonAuthBindEntity;
 import org.hswebframework.web.entity.organizational.PersonEntity;
 import org.hswebframework.web.organizational.authorization.PersonnelAuthentication;
+import org.hswebframework.web.organizational.authorization.PersonnelAuthenticationHolder;
 import org.hswebframework.web.service.organizational.PersonService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -44,8 +45,8 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("${hsweb.web.mappings.person:person}")
-@Authorize(permission = "person",description = "人员管理",dataAccess = @RequiresDataAccess)
-@Api(value = "人员管理",tags = "组织架构-人员管理")
+@Authorize(permission = "person", description = "人员管理", dataAccess = @RequiresDataAccess)
+@Api(value = "人员管理", tags = "组织架构-人员管理")
 public class PersonController implements SimpleGenericEntityController<PersonEntity, String, QueryParamEntity> {
 
     private PersonService personService;
@@ -107,6 +108,13 @@ public class PersonController implements SimpleGenericEntityController<PersonEnt
         return ResponseMessage.ok(authorization);
     }
 
+    @GetMapping("/{personId}/authorization")
+    @ApiOperation("查看人员权限信息")
+    @Authorize(action = Permission.ACTION_GET)
+    public ResponseMessage<PersonnelAuthentication> getPersonDetail(@PathVariable String personId) {
+        return ResponseMessage.ok(PersonnelAuthenticationHolder.getByPersonId(personId));
+    }
+
     @GetMapping("/{id}/detail")
     @ApiOperation("查看人员详情")
     @Authorize(action = Permission.ACTION_GET)