# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
def may_edit_media(request, media):
"""Check, if the request's user may edit the media details"""
- if media['uploader'] == request.user._id:
+ if media.uploader == request.user.id:
return True
- if request.user.is_admin:
+ if request.user.has_privilege(u'admin'):
return True
return False