Get the edit media view and link working

The link to 'edit' media should only be displayed if you have permission to edit the media.  Links to edit were only being provided via the manager interface in channel lists, so a method to check if a given user has permission to edit specific media did not exist.

This also fixes an error which was causing the edit view to error out.

#133