Use FPerm for invite and deinvite as opposed to checking ranks.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
@ -18,12 +19,13 @@ public class CmdFactionsDeinvite extends FCommand
|
||||
this.addRequiredArg("player");
|
||||
|
||||
this.addRequirements(ReqHasPerm.get(Perm.DEINVITE.node));
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
if ( ! FPerm.INVITE.has(sender, myFaction, true)) return;
|
||||
|
||||
FPlayer you = this.arg(0, ARFPlayer.getStartAny());
|
||||
if (you == null) return;
|
||||
|
||||
|
@ -5,9 +5,7 @@ import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.cmd.arg.ARFPlayer;
|
||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
|
||||
|
||||
@ -21,12 +19,13 @@ public class CmdFactionsInvite extends FCommand
|
||||
|
||||
this.addRequirements(ReqHasPerm.get(Perm.INVITE.node));
|
||||
this.addRequirements(ReqIsPlayer.get());
|
||||
this.addRequirements(ReqRoleIsAtLeast.get(Rel.OFFICER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
if ( ! FPerm.INVITE.has(sender, myFaction, true)) return;
|
||||
|
||||
FPlayer you = this.arg(0, ARFPlayer.getStartAny());
|
||||
if (you == null) return;
|
||||
|
||||
|
Reference in New Issue
Block a user