Add Admin and Permission check to /f perm (#1062)

* Remove perms Action

* Add Permission check to /f perm

* Refactor flight perm

* Add fly perm to GUI

* Remove useless perm check
This commit is contained in:
Dariasc 2018-03-06 16:46:55 -03:00 committed by Trent Hensler
parent fe464ba750
commit 693c831327
5 changed files with 6 additions and 7 deletions

View File

@ -34,7 +34,7 @@ public class CmdPerm extends FCommand {
senderMustBePlayer = true; senderMustBePlayer = true;
senderMustBeMember = true; senderMustBeMember = true;
senderMustBeModerator = false; senderMustBeModerator = false;
senderMustBeAdmin = false; senderMustBeAdmin = true;
} }
@Override @Override

View File

@ -48,7 +48,7 @@ public class CmdSethome extends FCommand {
// Can the player set the home for this faction? // Can the player set the home for this faction?
// Check for ALLOW access as well before we check for role. // Check for ALLOW access as well before we check for role.
if (faction == myFaction && access != Access.ALLOW) { if (faction == myFaction && access != Access.ALLOW) {
if (!Permission.SETHOME_ANY.has(sender) || !assertMinRole(Role.MODERATOR)) { if (!Permission.SETHOME_ANY.has(sender, true) || !assertMinRole(Role.MODERATOR)) {
return; return;
} }
} else { } else {

View File

@ -32,10 +32,9 @@ public enum PermissableAction {
ACCESS("access"), ACCESS("access"),
DISBAND("disband"), DISBAND("disband"),
PROMOTE("promote"), PROMOTE("promote"),
PERMS("perms"),
SETWARP("setwarp"), SETWARP("setwarp"),
WARP("warp"), WARP("warp"),
FLIGHT("fly"),; FLY("fly"),;
private String name; private String name;

View File

@ -938,7 +938,7 @@ public abstract class MemoryFPlayer implements FPlayer {
return true; return true;
} }
Access access = faction.getAccess(this, PermissableAction.FLIGHT); Access access = faction.getAccess(this, PermissableAction.FLY);
return access != null && access == Access.ALLOW; return access != null && access == Access.ALLOW;
} }

View File

@ -460,7 +460,7 @@ fperm-gui:
warp: 26 warp: 26
ban: 27 ban: 27
disband: 28 disband: 28
perms: 29 fly: 29
# Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color # Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color
materials: materials:
build: STAINED_CLAY build: STAINED_CLAY
@ -483,7 +483,7 @@ fperm-gui:
warp: STAINED_CLAY warp: STAINED_CLAY
ban: STAINED_CLAY ban: STAINED_CLAY
disband: STAINED_CLAY disband: STAINED_CLAY
perms: STAINED_CLAY fly: STAINED_CLAY
# Same dummy items format as above # Same dummy items format as above
dummy-items: dummy-items:
'0': '0':