Bukkit/Bukkit — pull request #423 by zml2008 (2011-11-25 01:17:31+00:00)
Title: Added ability for plugins to check permissions for players per-world.

Permissions can be registered in the global context (null world), but are overridden by world-specific permissions. Permissible.hasPermission() first checks the world, if the permissible is an Entity, and then checks globally. I also removed some unnecessary and expensive recalculatePermissions() calls.
This change to allow permissions to be registered for all worlds at once, even unloaded worlds, so that permissions managers have to listen to fewer events and only have to update permissions when they are actually changed and when the player joins, reducing load when players are switching worlds. Plugins can also check permissions for specific worlds, which is used in, as an example, CommandBook, to check whether a player can teleport in their target world, not just the world they currently reside in.