/** * Removes roles of the given list that have the type '{@link RoleType#Admin}' if the user calling the method is not a 'root admin'. * The actual removal is executed via {@link #removeRootAdminRoles(List)}. Therefore, if the method is called by a 'root admin', we do nothing here. */ protected void removeRootAdminRolesIfNeeded(List<? extends Role> roles) { Account account = getCurrentAccount(); if (!accountManager.isRootAdmin(account.getId())) { removeRootAdminRoles(roles); } }