mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 11:36:24 +00:00
Corrected permission testing a bit
This commit is contained in:
parent
a109134b92
commit
b07ba21659
2 changed files with 4 additions and 6 deletions
|
@ -37,16 +37,15 @@ public class Commandptime extends EssentialsCommand
|
||||||
// If no arguments we are reading the time
|
// If no arguments we are reading the time
|
||||||
if (args.length == 0)
|
if (args.length == 0)
|
||||||
{
|
{
|
||||||
// TODO do we need to check for the essentials.time permission? Or is that tested for us already.
|
|
||||||
getUsersTime(sender, users);
|
getUsersTime(sender, users);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = ess.getUser(sender);
|
User user = ess.getUser(sender);
|
||||||
if ( user != null && ! user.isAuthorized("essentials.time.player"))
|
if ( user != null && ! user.isAuthorized("essentials.ptime.others"))
|
||||||
{
|
{
|
||||||
// TODO should not be hardcoded !!
|
// TODO should not be hardcoded !!
|
||||||
sender.sendMessage(colorBad + "You are no authorized to set PlayerTime");
|
sender.sendMessage(colorBad + "You are not authorized to set others PlayerTime");
|
||||||
return; // TODO: How to not just die silently? in a good way??
|
return; // TODO: How to not just die silently? in a good way??
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,16 +37,15 @@ public class Commandtime extends EssentialsCommand
|
||||||
// If no arguments we are reading the time
|
// If no arguments we are reading the time
|
||||||
if (args.length == 0)
|
if (args.length == 0)
|
||||||
{
|
{
|
||||||
// TODO do we need to check for the essentials.time permission? Or is that tested for us already.
|
|
||||||
getWorldsTime(sender, worlds);
|
getWorldsTime(sender, worlds);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = ess.getUser(sender);
|
User user = ess.getUser(sender);
|
||||||
if ( user != null && ! user.isAuthorized("essentials.time.world"))
|
if ( user != null && ! user.isAuthorized("essentials.time.set"))
|
||||||
{
|
{
|
||||||
// TODO should not be hardcoded !!
|
// TODO should not be hardcoded !!
|
||||||
sender.sendMessage(colorBad + "You are no authorized to set the time");
|
sender.sendMessage(colorBad + "You are not authorized to set the time");
|
||||||
return; // TODO: How to not just die silently? in a good way??
|
return; // TODO: How to not just die silently? in a good way??
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue