Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshenghang committed Feb 6, 2025
1 parent 342f846 commit 96f72e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.seatunnel.app.service.IRoleService;
import org.apache.seatunnel.app.service.IUserService;
import org.apache.seatunnel.app.utils.PasswordUtils;
import org.apache.seatunnel.app.utils.ServletUtils;
import org.apache.seatunnel.server.common.PageData;
import org.apache.seatunnel.server.common.SeatunnelErrorEnum;
import org.apache.seatunnel.server.common.SeatunnelException;
Expand Down Expand Up @@ -135,6 +136,9 @@ public void update(UpdateUserReq updateReq) {
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(int id) {
if(ServletUtils.getCurrentUserId() == id){
throw new SeatunnelException(SeatunnelErrorEnum.INVALID_OPERATION, "Can't delete yourself");
}
userDaoImpl.delete(id);
roleServiceImpl.deleteByUserId(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public enum SeatunnelErrorEnum {
40005, "load engine metrics error", "load engine metrics error. error msg is [%s]"),
JOB_NO_VALUE_FOUND_FOR_PLACEHOLDER(
40006, "No value found for placeholder", "No value found for placeholder: [%s]"),
INVALID_OPERATION(40007, "invalid operation", "invalid operation [%s]"),

JOB_RUN_GENERATE_UUID_ERROR(50001, "generate uuid error", "generate uuid error"),
/* datasource and virtual table */
Expand Down

0 comments on commit 96f72e4

Please sign in to comment.