You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 07:26:18 +00:00
fix(housekeeping): allow core rank peer actions
Keep the housekeeping rank ceiling for normal staff, but treat the highest configured rank as the core rank so rank 7 can act on other rank 7 users without opening peer actions for lower staff ranks. Tests: mvn '-Dtest=HousekeepingTargetRankGuardContractTest,HousekeepingMutationGuardTest,HousekeepingSetUserRankEventTest,HousekeepingTargetRankGuardContractTest' test
This commit is contained in:
+7
-3
@@ -24,11 +24,15 @@ class HousekeepingTargetRankGuardContractTest {
|
||||
);
|
||||
|
||||
@Test
|
||||
void privilegedUserActionsRejectPeerAndHigherRankTargets() throws Exception {
|
||||
void privilegedUserActionsRejectPeerRanksUnlessOperatorIsCoreRank() throws Exception {
|
||||
String guard = Files.readString(Path.of("src/main/java/com/eu/habbo/messages/incoming/housekeeping/HousekeepingTargetRankGuard.java"));
|
||||
|
||||
assertTrue(guard.contains("targetInfo.getRank().getId() < operator.getHabboInfo().getRank().getId()"),
|
||||
"Housekeeping user actions must only target lower-ranked users");
|
||||
assertTrue(guard.contains("targetRankId < operatorRankId"),
|
||||
"non-core housekeeping operators must only target lower-ranked users");
|
||||
assertTrue(guard.contains("isCoreRank(operatorRankId) && targetRankId <= operatorRankId"),
|
||||
"the highest/core rank should be allowed to target peer ranks");
|
||||
assertTrue(guard.contains("private static boolean isCoreRank(int rankId)"),
|
||||
"core-rank detection should be centralized in the target-rank guard");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user