agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemRoleManager.java
/**
	 * Removes all but the system owner roles on a system.
	 * 
	 * @param createdBy the username of the user clearing the roles
	 * @throws SystemException if the system could not be updated
	 */
Removes all but the system owner roles on a system.

@param createdBy the username of the user clearing the roles
@throws SystemException if the system could not be updated
Removes all but the system owner roles on a system . @param createdBy the username of the user clearing the roles @throws SystemException if the system could not be updated
public void clearRoles(String createdBy) throws SystemException
	{
		SystemDao dao = new SystemDao();
	    Set<SystemRole> currentRoles = getSystem().getRoles();
		SystemRole[] deletedRoles = currentRoles.toArray(new SystemRole[] {});
		for (SystemRole role: deletedRoles) {
			getSystem().removeRole(role);
		}
		dao.persist(getSystem());
		if (!getSystem().isPubliclyAvailable())
		{
			for (SystemRole deletedRole: deletedRoles) {
				this.eventProcessor.processPermissionEvent(getSystem(), new SystemRole(deletedRole.getUsername(), RoleType.NONE), createdBy);
			}
		}
	}
public void clearRoles ( String createdBy ) throws SystemException { SystemDao dao = new SystemDao ( ) ; Set < SystemRole > currentRoles = getSystem ( ) . getRoles ( ) ; SystemRole [ ] deletedRoles = currentRoles . toArray ( new SystemRole [ ] { } ) ; for ( SystemRole role : deletedRoles ) { getSystem ( ) . removeRole ( role ) ; } dao . persist ( getSystem ( ) ) ; if ( ! getSystem ( ) . isPubliclyAvailable ( ) ) { for ( SystemRole deletedRole : deletedRoles ) { this . eventProcessor . processPermissionEvent ( getSystem ( ) , new SystemRole ( deletedRole . getUsername ( ) , RoleType . NONE ) , createdBy ) ; } } }
Removes all but the system owner roles on a system.
Removes all but the system owner roles on a system .
//		setSystem(dao.merge(getSystem()));