diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-03 18:43:20 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-03 18:43:20 -0500 |
commit | 3f0679cd78363801f7b2b99a3278f416d45f5624 (patch) | |
tree | 0ef2296cf6fc1295d8cb8466a1c359199e74440a /mediagoblin/edit/lib.py | |
parent | 55c74e1e4b36d56c1f3c8e69a4cbea43843093c8 (diff) | |
parent | d5e90fe4b487e86261331fab0f7c08f12462625d (diff) | |
download | mediagoblin-3f0679cd78363801f7b2b99a3278f416d45f5624.tar.lz mediagoblin-3f0679cd78363801f7b2b99a3278f416d45f5624.tar.xz mediagoblin-3f0679cd78363801f7b2b99a3278f416d45f5624.zip |
Merge branch 'media_edit'
Diffstat (limited to 'mediagoblin/edit/lib.py')
-rw-r--r-- | mediagoblin/edit/lib.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mediagoblin/edit/lib.py b/mediagoblin/edit/lib.py new file mode 100644 index 00000000..2a810349 --- /dev/null +++ b/mediagoblin/edit/lib.py @@ -0,0 +1,24 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc +# +# 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +def may_edit_media(request, media): + """Check, if the request's user may edit the media details""" + if media['uploader'] == request.user['_id']: + return True + if request.user['is_admin']: + return True + return False |