Updated code

This commit is contained in:
harish
2024-10-26 17:48:31 +05:30
parent 24d4f6a65c
commit 9b1c86d179
13 changed files with 87 additions and 58 deletions

View File

@@ -139,14 +139,6 @@ public class Validator {
Map<String, Object> userInfo= tokenProvider.getUserInfoAndUserIdFromToken(request);
return Long.parseLong(userInfo.get("userId").toString());
}
public UserEntity validatePreInstructor(HttpServletRequest request, Long userId) {
UserEntity user = validateUser(request);
if(Boolean.FALSE.equals(RoleStatusEnum.ROLE_PRE_INSTRUCTOR.getValue().equals(user.getRoleEntity().getRoleType()))||Boolean.FALSE.equals(user.getId().equals(userId))) {
throw new ForbiddenAccessException(Status.FORBIDDEN, Translator.toLocale(GepafinConstant.PERMISSION_DENIED));
}
return userService.validateUser(userId);
}
public CallEntity validateUserWithCall(UserEntity user, Long callId) {
CallEntity callEntity = callService.validateCall(callId);
if(Boolean.FALSE.equals(user.getHub().getId().equals(callEntity.getHub().getId()))) {