Hide role dropdown on user page if user is owner

Closes #3764
This commit is contained in:
Matt Enlow 2014-08-12 18:06:34 -06:00
parent 6aba193bb5
commit 150ce6c9b9

View File

@ -5,11 +5,13 @@ var SettingsUserView = Ember.View.extend({
return this.get('controller.user.id') !== this.get('currentUser.id');
}),
isNotOwnersProfile: Ember.computed.not('controller.user.isOwner'),
canAssignRoles: Ember.computed.or('currentUser.isAdmin', 'currentUser.isOwner'),
canMakeOwner: Ember.computed.and('currentUser.isOwner', 'isNotOwnProfile', 'controller.user.isAdmin'),
rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles'),
rolesDropdownIsVisible: Ember.computed.and('isNotOwnProfile', 'canAssignRoles', 'isNotOwnersProfile'),
deleteUserActionIsVisible: Ember.computed('currentUser', 'canAssignRoles', 'controller.user', function () {
if ((this.get('canAssignRoles') && this.get('isNotOwnProfile') && !this.get('controller.user.isOwner')) ||