Added abilities to edit and update publications

Cso admin can now publish a survey that is shared with him
Abstracted some SQL into a method