Skip to content

Commit de8f79d

Browse files
committed
Removed checks for administrator and rely solely on permissions.
1 parent 9210c3b commit de8f79d

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

server/src/main/java/com/objectcomputing/checkins/services/memberprofile/anniversaryreport/AnniversaryReportServicesImpl.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.objectcomputing.checkins.exceptions.PermissionException;
44
import com.objectcomputing.checkins.services.memberprofile.MemberProfile;
55
import com.objectcomputing.checkins.services.memberprofile.MemberProfileServices;
6-
import com.objectcomputing.checkins.services.memberprofile.currentuser.CurrentUserServices;
76
import io.micronaut.core.annotation.Nullable;
87
import jakarta.inject.Singleton;
98

@@ -18,20 +17,13 @@
1817
public class AnniversaryReportServicesImpl implements AnniversaryServices {
1918

2019
private final MemberProfileServices memberProfileServices;
21-
private final CurrentUserServices currentUserServices;
2220

23-
public AnniversaryReportServicesImpl(MemberProfileServices memberProfileServices,
24-
CurrentUserServices currentUserServices) {
21+
public AnniversaryReportServicesImpl(MemberProfileServices memberProfileServices) {
2522
this.memberProfileServices = memberProfileServices;
26-
this.currentUserServices = currentUserServices;
2723
}
2824

2925
@Override
3026
public List<AnniversaryReportResponseDTO> findByValue(@Nullable String[] months) {
31-
if (!currentUserServices.isAdmin()) {
32-
throw new PermissionException("You do not have permission to access this resource.");
33-
}
34-
3527
List<MemberProfile> memberProfileAll = new ArrayList<>();
3628
Set<MemberProfile> memberProfiles = memberProfileServices.findByValues(null, null, null, null, null, null,
3729
false);

server/src/main/java/com/objectcomputing/checkins/services/memberprofile/birthday/BirthDayServicesImpl.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.objectcomputing.checkins.exceptions.PermissionException;
44
import com.objectcomputing.checkins.services.memberprofile.MemberProfile;
55
import com.objectcomputing.checkins.services.memberprofile.MemberProfileServices;
6-
import com.objectcomputing.checkins.services.memberprofile.currentuser.CurrentUserServices;
76

87
import jakarta.inject.Singleton;
98
import java.time.LocalDate;
@@ -15,19 +14,13 @@
1514
public class BirthDayServicesImpl implements BirthDayServices{
1615

1716
private final MemberProfileServices memberProfileServices;
18-
private final CurrentUserServices currentUserServices;
1917

20-
public BirthDayServicesImpl(MemberProfileServices memberProfileServices, CurrentUserServices currentUserServices) {
18+
public BirthDayServicesImpl(MemberProfileServices memberProfileServices) {
2119
this.memberProfileServices = memberProfileServices;
22-
this.currentUserServices = currentUserServices;
2320
}
2421

2522
@Override
2623
public List<BirthDayResponseDTO> findByValue(String[] months, Integer[] daysOfMonth) {
27-
if (!currentUserServices.isAdmin()) {
28-
throw new PermissionException("You do not have permission to access this resource.");
29-
}
30-
3124
Set<MemberProfile> memberProfiles = memberProfileServices.findByValues(null, null, null, null, null, null, false);
3225
List<MemberProfile> memberProfileAll = new ArrayList<>(memberProfiles);
3326
if (months != null) {

0 commit comments

Comments
 (0)