 
   createSettingsView: ->
 
-    userRoles = @getData().roles
+    unless @settings
+      @settings  = new KDCustomHTMLView
+        cssClass : 'settings hidden'
 
-    @settings  = new KDCustomHTMLView
-      cssClass : 'settings hidden'
+    buttons = buttonSet[@loggedInUserRole.slug][@memberRole.slug]
 
-    @settings.addSubView new KDButtonView
-      cssClass : 'solid compact outline'
-      title    : 'MAKE ADMIN'
+    buttons.forEach (button) =>
+      buttonView = new KDButtonView
+        cssClass : kd.utils.curry 'solid compact outline', button.extraClass
+        title    : button.buttonTitle
+        loader   : color: "#444444"
+        callback : => @emit 'UserRoleChangeRequested', button.slug
 
-    @settings.addSubView new KDButtonView
-      cssClass : 'solid compact outline'
-      title    : 'MAKE MODERATOR'
+      @actionButtons[button.slug] = buttonView
+      @settings.addSubView buttonView
 
-    @settings.addSubView new KDButtonView
-      cssClass : 'solid compact outline'
-      title    : 'MAKE OWNER'
+
+
+
+
   toggleSettings: ->
 
-    @settings.addSubView new KDButtonView
-      cssClass : 'solid compact outline red'
-      title    : 'KICK USER'
     @settings.toggleClass  'hidden'
     @roleLabel.toggleClass 'active'
 

kd                     = require 'kd'
JView                  = require 'app/jview'
AvatarView             = require 'app/commonviews/avatarviews/avatarview'
KDButtonView           = kd.ButtonView
KDListItemView         = kd.ListItemView
KDCustomHTMLView       = kd.CustomHTMLView
getFullnameFromAccount = require 'app/util/getFullnameFromAccount'

# a user be a Member, Admin and Owner at the same time but in the UI we should
# show the role name which has the most permissions.
defaultRoles =
  guest      : nicename : 'Guest',     priority : 0
  member     : nicename : 'Member',    priority : 1
  moderator  : nicename : 'Moderator', priority : 2
  admin      : nicename : 'Admin',     priority : 3
  owner      : nicename : 'Owner',     priority : 4


module.exports = class MemberItemView extends KDListItemView

    fullname = getFullnameFromAccount data
    nickname = data.profile.nickname
    email    = "#{nickname}@koding.com"

    return """
      <div class="details">
