On leave or out of office hours with their minister’s approval. That excludes, by definition, being sat at your desk all day toiling endlessly to get the candidate elected, shooting off emails to all and sundry and running up the national debt on the phone for hours. The whole purpose of the restriction was to prevent the situation we have now. Dozens, and Guido means dozens, of SpAds doing little else but plot and conspire to further the private interests of party candidates in an internal party election. They are not acting to further the political interests of the government minister, the job the taxpayer pays them to do, they are acting to further the interests of the private individual climbing the greasy pole.
That is not appropriate activity for civil servants, which is what SpAds are, and that is the reason why the Code of Conduct exists. Clause 7 in the model contract for Special Advisers states bluntly:
Special Advisers should not use official resources for Party political activity. They are employed to serve the objectives of the Government and the Department in which they work. It is this which justifies their being paid from public funds and being able to use public resources, and explains why their participation in party politics is carefully limited.