Added bukkit permissions

This commit is contained in:
Robin Kupper
2011-07-24 10:03:24 +02:00
parent 9be1e1d86e
commit eea55bd75e
2 changed files with 48 additions and 3 deletions
+4 -2
View File
@@ -241,8 +241,10 @@ public class LogBlock extends JavaPlugin
boolean hasPermission(CommandSender sender, String permission) {
if (permissions != null && sender instanceof Player)
return permissions.permission((Player)sender, permission);
if (permission.equals("logblock.lookup") || permission.equals("logblock.hide") || permission.equals("logblock.rollback") || permission.equals("logblock.tp") || permission.equals("logblock.clearlog"))
return sender.isOp();
if (sender instanceof ConsoleCommandSender)
return true;
if (sender instanceof Player)
return ((Player)sender).hasPermission(permission);
return true;
}
+44 -1
View File
@@ -9,4 +9,47 @@ commands:
lb:
description: 'LogBlock commands.'
usage: 'Usage: /<command> help'
aliases: []
aliases: []
permissions:
logblock.*:
description: Gives access to all LogBlock commands
children:
logblock.tool: true
logblock.toolblock: true
logblock.lookup: true
logblock.rollback: true
logblock.clearlog: true
logblock.hide: true
logblock.tp: true
logblock.me: true
logblock.ignoreRestrictions: true
logblock.tool:
description: 'Allows using the tool (the woodpickaxe) with default query (toolQuery in config)'
default: true
logblock.toolblock:
description: 'Allows using the tool block (the bedrock block) with default query (toolBlockQuery in config)'
default: true
logblock.lookup:
description: 'Grants access to /lb lookup commands and allows defining custom tool queries'
default: op
logblock.rollback:
description: 'Allows rollback, redo and write logfiles'
default: op
logblock.clearlog:
description: 'Allows to use /lb clearlog'
default: op
logblock.hide:
description: 'Allows to hide from logging'
default: op
logblock.tp:
description: 'Allows to use /lb tp'
default: op
logblock.tp:
description: 'Allows to use /lb tp'
default: op
logblock.me:
description: 'Allows to see oneselfs stats with /lb me'
default: true
logblock.ignoreRestrictions:
description: 'Allows to ignore the rollback restrictions rollback.maxTime and rollback.maxArea'
default: op