Skip to content

Commit

Permalink
refactor(Attendee): 불분명한 메서드명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ikjo39 committed Jul 31, 2024
1 parent 0d2521a commit 2e52638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Attendee(Meeting meeting, String name, String password, Role role) {
this(meeting, new AttendeeName(name), new AttendeePassword(password), role);
}

public boolean hasPermission() {
public boolean isHost() {
return role.isHost();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public void lock(String uuid, long id) {
.orElseThrow(() -> new MomoException(MeetingErrorCode.NOT_FOUND_MEETING));
Attendee attendee = attendeeRepository.findByIdAndMeeting(id, meeting)
.orElseThrow(() -> new MomoException(AttendeeErrorCode.NOT_FOUND_ATTENDEE));
validateAttendeePermission(attendee);
validateHostPermission(attendee);
meeting.lock();
}

private void validateAttendeePermission(Attendee attendee) {
if (!attendee.hasPermission()) {
private void validateHostPermission(Attendee attendee) {
if (!attendee.isHost()) {
throw new MomoException(AttendeeErrorCode.ACCESS_DENIED);
}
}
Expand Down

0 comments on commit 2e52638

Please sign in to comment.