
import at.dockwork.security.domain.*




class UpdateScriptService {

	def run(def connection, def dataSourceFields) {

		Role gwtRole = Role.findByAuthority("ROLE_GWT")
		if (gwtRole) {
			User.findAll().each { user ->
				UserRole userRole = UserRole.findWhere(user:user, role:gwtRole)
				if (!userRole) {
					userRole = new UserRole(user:user, role:gwtRole)
					userRole.save()
				}
			}
		}

		true
	}
}
