Adding world permission checks to:

tpaall tpall tpahere tphere tpohere
User is required to have the permission for the world he is in, before he can teleport users outside this world, to it.
This commit is contained in:
KHobbits 2012-03-27 15:28:40 +01:00
parent 5d45495371
commit 97eed50ccc
6 changed files with 30 additions and 2 deletions

View file

@ -25,12 +25,14 @@ public class Commandtpaccept extends EssentialsCommand
throw new Exception(_("noPendingRequest"));
}
if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
if (user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpahere") && !target.isAuthorized("essentials.tpaall"))
|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))))
{
throw new Exception(_("noPendingRequest"));
}
if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
if (!user.isTpRequestHere() && (!target.isAuthorized("essentials.tpa")
|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !user.isAuthorized("essentials.world." + target.getWorld().getName()))))
{