From fdd66c057cd1b23b6e3f5ffe2382010e932f8af7 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 3 Sep 2011 00:52:28 +0100 Subject: [PATCH] New BroadcastPermissions default permission registrations By: Dinnerbone --- .../permissions/BroadcastPermissions.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java diff --git a/paper-api/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java b/paper-api/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java new file mode 100644 index 0000000000..092370e98a --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java @@ -0,0 +1,22 @@ +package org.bukkit.util.permissions; + +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionDefault; + +public final class BroadcastPermissions { + private static final String ROOT = "bukkit.broadcast"; + private static final String PREFIX = ROOT + "."; + + private BroadcastPermissions() {} + + public static Permission registerPermissions(Permission parent) { + Permission broadcasts = DefaultPermissions.registerPermission(ROOT, "Allows the user to receive all broadcast messages", parent); + + DefaultPermissions.registerPermission(PREFIX + "admin", "Allows the user to receive administrative broadcasts", PermissionDefault.OP, broadcasts); + DefaultPermissions.registerPermission(PREFIX + "user", "Allows the user to receive user broadcasts", PermissionDefault.TRUE, broadcasts); + + broadcasts.recalculatePermissibles(); + + return broadcasts; + } +}