Don't allow support to set ranks for admin+ or content users

This commit is contained in:
Spencer 2018-01-06 16:47:21 -05:00 committed by Alexander Meech
parent 14daa939e3
commit 5c6a9ea879

View File

@ -101,6 +101,12 @@ public class SupportRankListPage extends SupportPage
private void handleGroupSet(PermissionGroup group) private void handleGroupSet(PermissionGroup group)
{ {
if (_target.inheritsFrom(PermissionGroup.ADMIN) || _target.inheritsFrom(PermissionGroup.CONTENT))
{
message("You can't set this user's rank!");
return;
}
getPlugin().getClientManager().setPrimaryGroup(_target.getAccountId(), group, () -> { getPlugin().getClientManager().setPrimaryGroup(_target.getAccountId(), group, () -> {
message("You have applied the rank " + group.getDisplay(true, true, true, true).toUpperCase() + C.mBody + " to " + C.cYellow + _target.getName()); message("You have applied the rank " + group.getDisplay(true, true, true, true).toUpperCase() + C.mBody + " to " + C.cYellow + _target.getName());
_target.setPrimaryGroup(group); _target.setPrimaryGroup(group);