NoPermissionException fires with wrong permissions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ plugin Java được cung cấp với hai lệnh lần lượt yêu cầu permission1 và permission2, sau đó theo dõi cách NoPermissionException xây dựng thông báo của nó. Công việc được hoàn tất khi command1 chỉ báo cáo permission1 và command2 chỉ báo cáo permission2 khi người gửi thiếu cả hai quyền.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When the command sender has no permissions relevant to the command manager, and attempts to use a command, NoPermissionException will have all permissions rather than the appropriate one.
Versions: cloud-paper 1.6.2 and 1.7.0-SNAPSHOT (bcc9d30)
Code:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
try {
var commandManager = PaperCommandManager.createNative(this, CommandExecutionCoordinator.simpleCoordinator());
commandManager.registerExceptionHandler(NoPermissionException.class, (ignored, exception) ->
getLogger().info(exception::getMessage)
);
commandManager.command(commandManager.commandBuilder("command1")
.permission("permission1")
.handler(context -> context.getSender().sendMessage("Handling command1"))
);
commandManager.command(commandManager.commandBuilder("command2")
.permission("permission2")
.handler(context -> context.getSender().sendMessage("Handling command2"))
);
} catch (Exception ignored) {}
}
}
Output:
[11:09:44 INFO]: SirSalad issued server command: /command1
[11:09:44 INFO]: [MyPlugin] Missing permission '(permission2)|(permission1)' <-- should only have permission1
[11:09:47 INFO]: SirSalad issued server command: /command2
[11:09:47 INFO]: [MyPlugin] Missing permission '(permission2)|(permission1)' <-- should only have permission2
[11:09:58 INFO]: SirSalad issued server command: /lp user SirSalad permission set permission1 true
[11:10:03 INFO]: SirSalad issued server command: /command1
[11:10:05 INFO]: SirSalad issued server command: /command2
[11:10:05 INFO]: [MyPlugin] Missing permission 'permission2' <-- this is correct
- Ngôn ngữ chính
- Java
- Star
- 546
- Fork
- 61
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Incendo/cloud
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Tất cả issue của Incendo/cloud
Issue tương tự
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
erkamyaman/rust-anything#963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deferred
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Sanne/incus-spawn#2768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
morluto/rea#15041 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Spring SDK returns null for successful plain-text String responsesCó thể đã có người làm @Chrisp12138 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày