java/code/src/com/redhat/rhn/manager/org/MigrationManager.java | 2 -
java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java | 15 ++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
New commits:
commit cd542846056d042a773a13cb5204d0e65267acc8
Author: Brad Buckingham <bbuckingham(a)redhat.com>
Date: Tue Jun 2 15:51:14 2009 -0400
503545 - api - system.migrateSystems - update to handle systems that are in a system
group
Currently, if a sat admin attempts to migrate a system from an org that the
sat admin is not a member of, the request is denied. The reason being
the sat admin does not normally have 'permission' (e.g. ui) to do this.
diff --git a/java/code/src/com/redhat/rhn/manager/org/MigrationManager.java
b/java/code/src/com/redhat/rhn/manager/org/MigrationManager.java
index a498c04..4d8eafa 100644
--- a/java/code/src/com/redhat/rhn/manager/org/MigrationManager.java
+++ b/java/code/src/com/redhat/rhn/manager/org/MigrationManager.java
@@ -122,7 +122,7 @@ public class MigrationManager extends BaseManager {
for (ManagedServerGroup group : server.getManagedGroups()) {
List<Server> tempList = new LinkedList<Server>();
tempList.add(server);
- manager.removeServers(group, tempList, user);
+ manager.removeServers(group, tempList);
}
// Remove custom data values (aka System->CustomInfo)
diff --git a/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
b/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
index 463147c..2c3c9d6 100644
--- a/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
@@ -357,20 +357,29 @@ public class ServerGroupManager {
/**
* Dissociates a bunch of servers from a server group
* @param sg the server group to process
- * @param servers a collection of servers to deassociate
+ * @param servers a collection of servers to dissociate
* @param loggedInUser the loggedInUser needed for credentials
*/
public void removeServers(ServerGroup sg, Collection servers,
User loggedInUser) {
validateAccessCredentials(loggedInUser, sg, sg.getName());
validateAdminCredentials(loggedInUser);
+ removeServers(sg, servers);
+ }
+
+ /**
+ * Dissociates a bunch of servers from a server group.
+ * **WARNING** This method does not validate the user's access or
+ * admin credentials; therefore, it should be used with caution.
+ * @param sg the server group to process
+ * @param servers a collection of servers to dissociate
+ */
+ public void removeServers(ServerGroup sg, Collection servers) {
for (Iterator itr = servers.iterator(); itr.hasNext();) {
Server s = (Server) itr.next();
SystemManager.removeServerFromServerGroup(s, sg);
}
-
}
-
/**
* Returns the admins of a given servergroup. This list includes
Show replies by date