diff --git a/pandora/user/views.py b/pandora/user/views.py index 83432bf1c..182a602b8 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -362,7 +362,7 @@ def editUser(request, data): response = json_response(status=403, text='email already in use') return render_to_json_response(response) user.email = data['email'] - if 'level' in data: + if 'level' in data and request.user.profile.get_level() == 'admin': profile.set_level(data['level']) if 'notes' in data: profile.notes = data['notes'] diff --git a/static/js/usersDialog.js b/static/js/usersDialog.js index 4455d5479..bf997c641 100644 --- a/static/js/usersDialog.js +++ b/static/js/usersDialog.js @@ -680,19 +680,27 @@ pandora.ui.usersDialog = function() { } }), - Ox.Select({ - id: 'level', - items: pandora.site.userLevels.slice(1).map(function(level) { - return { - id: level, - title: Ox.toTitleCase(level) - }; + pandora.user.level == 'admin' + ? Ox.Select({ + id: 'level', + items: pandora.site.userLevels.slice(1).map(function(level) { + return { + id: level, + title: Ox.toTitleCase(level) + }; + }), + label: Ox._('Level'), + labelWidth: 80, + value: user.level, + width: formWidth - 16 + }) : Ox.Input({ + disabled: true, + id: 'level', + label: Ox._('Level'), + labelWidth: 80, + value: Ox.toTitleCase(user.level), + width: formWidth - 16 }), - label: Ox._('Level'), - labelWidth: 80, - value: user.level, - width: formWidth - 16 - }), Ox.Checkbox({ id: 'newsletter', label: Ox._('Newsletter'),