Fix getTeamMembers query to scope permissions to the global server
This commit is contained in:
parent
e43cbbf9e4
commit
edaebe9e4a
|
|
@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
@ -27,7 +28,7 @@ public final class StaffPtToStaffPlaytimeMapper {
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(entry.getKey().toString())
|
.orElse(entry.getKey().toString())
|
||||||
);
|
);
|
||||||
dto.setLastPlayed(OffsetDateTime.from(Instant.ofEpochMilli(lastPlayedMillis)));
|
dto.setLastPlayed(OffsetDateTime.ofInstant(Instant.ofEpochMilli(lastPlayedMillis), ZoneOffset.UTC));
|
||||||
dto.setPlaytime((int) TimeUnit.MILLISECONDS.toMinutes(entry.getValue().totalPlaytime()));
|
dto.setPlaytime((int) TimeUnit.MILLISECONDS.toMinutes(entry.getValue().totalPlaytime()));
|
||||||
results.add(dto);
|
results.add(dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class StaffPtService {
|
public class StaffPtService {
|
||||||
private final static String STAFF_GROUPS = "group.admin, group.developer, group.headmod, group.manager, group.moderator, group.owner, group.trainee";
|
private final static String STAFF_GROUPS = "'group.admin', 'group.developer', 'group.headmod', 'group.manager', 'group.moderator', 'group.owner', 'group.trainee'";
|
||||||
private final StaffPtToStaffPlaytimeMapper staffPtToStaffPlaytimeMapper;
|
private final StaffPtToStaffPlaytimeMapper staffPtToStaffPlaytimeMapper;
|
||||||
|
|
||||||
public Optional<List<StaffPlaytimeDto>> getStaffPlaytime(Instant from, Instant to) {
|
public Optional<List<StaffPlaytimeDto>> getStaffPlaytime(Instant from, Instant to) {
|
||||||
|
|
@ -49,7 +49,7 @@ public class StaffPtService {
|
||||||
.runQuery(sqlSession -> {
|
.runQuery(sqlSession -> {
|
||||||
String staffUUIDs = staffMembers.stream()
|
String staffUUIDs = staffMembers.stream()
|
||||||
.map(Player::uuid)
|
.map(Player::uuid)
|
||||||
.map(String::valueOf)
|
.map(uuid -> "'" + uuid + "'")
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
log.debug("Loading staff playtime for group");
|
log.debug("Loading staff playtime for group");
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export class StaffPtComponent implements OnInit {
|
||||||
|
|
||||||
staffPt = signal<StaffPlaytime[]>([]);
|
staffPt = signal<StaffPlaytime[]>([]);
|
||||||
|
|
||||||
weekStart = signal<Date>(this.getStartOfWeek(new Date()));
|
weekStart = signal<Date>(this.getStartOfWeek(new Date('2024-01-01')));
|
||||||
weekEnd = computed(() => this.getEndOfWeek(this.weekStart()));
|
weekEnd = computed(() => this.getEndOfWeek(this.weekStart()));
|
||||||
|
|
||||||
todayStart = signal<Date>(this.startOfDay(new Date()));
|
todayStart = signal<Date>(this.startOfDay(new Date()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user