Major f perm fix; Fix sethome permission check (#1079)
This commit is contained in:
@@ -108,16 +108,13 @@ public class CmdPerm extends FCommand {
|
||||
}
|
||||
|
||||
private Permissable getPermissable(String name) {
|
||||
try {
|
||||
return Relation.valueOf(name.toUpperCase());
|
||||
} catch (Exception e) {
|
||||
if (Role.fromString(name.toUpperCase()) != null) {
|
||||
return Role.fromString(name.toUpperCase());
|
||||
} else if (Relation.fromString(name.toUpperCase()) != null) {
|
||||
return Relation.fromString(name.toUpperCase());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Role.valueOf(name.toUpperCase());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,15 +45,16 @@ public class CmdSethome extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
// Can the player set the home for this faction?
|
||||
// Check for ALLOW access as well before we check for role.
|
||||
if (faction == myFaction && access != Access.ALLOW) {
|
||||
if (!Permission.SETHOME_ANY.has(sender, true) || !assertMinRole(Role.MODERATOR)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Permission.SETHOME_ANY.has(sender, true)) {
|
||||
return;
|
||||
// If player does not have allow run extra permission checks
|
||||
if (access != Access.ALLOW) {
|
||||
if (faction == myFaction) {
|
||||
if (!assertMinRole(Role.MODERATOR)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Permission.SETHOME_ANY.has(sender, true)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user