fixed bug where delegate couldn't edit courses when user.id and userprofile.id of the represented user differ