We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f8b91a commit 220254cCopy full SHA for 220254c
1 file changed
src/main/java/everTale/everTale_be/domain/profile/service/ProfileService.java
@@ -152,6 +152,12 @@ public void deleteProfile(String accessToken){
152
profileRepository.anonymizeProfile(profileId);
153
}
154
155
+ public void isParent(Profile profile) {
156
+ if (profile.getProfileType() != ProfileType.PARENT) {
157
+ throw new UnAuthorizedHandler(ErrorStatus.UNAUTHORIZED_PROFILE_ACCESS);
158
+ }
159
160
+
161
public void validateChildProfileAccess(Profile profile, Long profileId) {
162
if (!profile.getId().equals(profileId)) {
163
throw new UnAuthorizedHandler(ErrorStatus.UNAUTHORIZED_PROFILE_ACCESS);
0 commit comments