|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.api.controller; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.enums.Status.REVOKE_PROJECT_ERROR; |
|
|
|
|
import static org.apache.dolphinscheduler.api.enums.Status.AUTHORIZED_USER_ERROR; |
|
|
|
|
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_USER_ERROR; |
|
|
|
|
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_USER_BY_ID_ERROR; |
|
|
|
@ -258,6 +259,30 @@ public class UsersController extends BaseController {
|
|
|
|
|
return returnDataList(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* revoke project |
|
|
|
|
* |
|
|
|
|
* @param loginUser login user |
|
|
|
|
* @param userId user id |
|
|
|
|
* @param projectCode project code |
|
|
|
|
* @return revoke result code |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "revokeProject", notes = "REVOKE_PROJECT_NOTES") |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100"), |
|
|
|
|
@ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, type = "Long", example = "100") |
|
|
|
|
}) |
|
|
|
|
@PostMapping(value = "/revoke-project") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(REVOKE_PROJECT_ERROR) |
|
|
|
|
@AccessLogAnnotation |
|
|
|
|
public Result revokeProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
|
@RequestParam(value = "userId") int userId, |
|
|
|
|
@RequestParam(value = "projectCode") long projectCode) { |
|
|
|
|
Map<String, Object> result = this.usersService.revokeProject(loginUser, userId, projectCode); |
|
|
|
|
return returnDataList(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* grant resource |
|
|
|
|
* |
|
|
|
|