summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-09-03 00:52:28 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-09-03 00:52:28 +0100
commit6dab14e2d72b947d7998f11951a277557df17301 (patch)
tree813391c3fc98b2f16df7ff0c362342ed584f14ad /src/main/java/org
parent6d3a7798947ef6d4f34398564e56cf92444515ca (diff)
downloadbukkit-6dab14e2d72b947d7998f11951a277557df17301.tar
bukkit-6dab14e2d72b947d7998f11951a277557df17301.tar.gz
bukkit-6dab14e2d72b947d7998f11951a277557df17301.tar.lz
bukkit-6dab14e2d72b947d7998f11951a277557df17301.tar.xz
bukkit-6dab14e2d72b947d7998f11951a277557df17301.zip
New BroadcastPermissions default permission registrations
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java b/src/main/java/org/bukkit/util/permissions/BroadcastPermissions.java
new file mode 100644
index 00000000..092370e9
--- /dev/null
+++ b/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;
+ }
+}