Module: Vhost::AdminUsersHelperExtensions

Defined in:
lib/vhost/admin_users_helper_extensions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/vhost/admin_users_helper_extensions.rb', line 2

def self.included(receiver)
  receiver.send :alias_method_chain, :roles, :site_admin
  receiver.send :define_method, :sites do |user|
    sites = user.sites.collect{|site| site.title}
    sites.join("<br/>")
  end
end

Instance Method Details

#roles_with_site_admin(user) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/vhost/admin_users_helper_extensions.rb', line 10

def roles_with_site_admin(user)
  roles = []
  roles << 'Admin' if user.admin?
  roles << 'Site Admin' if user.site_admin?
  roles << 'Designer' if user.designer?
  roles.join(', ')
end