Sha256: 9e7f2895fa41abf95175588f6d0f3abc43c5a74858c87d011fd3059c9e0b40e0

Contents?: true

Size: 638 Bytes

Versions: 27

Compression:

Stored size: 638 Bytes

Contents

class Caboose::RolePlugin < Caboose::CaboosePlugin

  def self.admin_nav(nav, user, page)
    return nav if user.nil? || !user.is_allowed('roles', 'view')
       
    item = {
      'id' => 'roles',       
      'text' => 'Roles',
      'children' => []
    }
    if (user.is_allowed('roles', 'view'))
      item['children'] << {
        'href' => '/admin/roles', 
        'text' => 'View All Roles',
        'modal' => true
      }
    end
    if (user.is_allowed('roles', 'add'))
      item['children'] << {
        'href' => '/admin/roles/new', 
        'text' => 'New Role'
      }
    end
    nav << item
    return nav
  end
  
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
caboose-cms-0.2.66 app/models/caboose/role_plugin.rb
caboose-cms-0.2.65 app/models/caboose/role_plugin.rb
caboose-cms-0.2.64 app/models/caboose/role_plugin.rb
caboose-cms-0.2.62 app/models/caboose/role_plugin.rb
caboose-cms-0.2.57 app/models/caboose/role_plugin.rb
caboose-cms-0.2.55 app/models/caboose/role_plugin.rb
caboose-cms-0.2.54 app/models/caboose/role_plugin.rb
caboose-cms-0.2.52 app/models/caboose/role_plugin.rb
caboose-cms-0.2.50 app/models/caboose/role_plugin.rb
caboose-cms-0.2.49 app/models/caboose/role_plugin.rb
caboose-cms-0.2.48 app/models/caboose/role_plugin.rb
caboose-cms-0.2.47 app/models/caboose/role_plugin.rb
caboose-cms-0.2.46 app/models/caboose/role_plugin.rb
caboose-cms-0.2.45 app/models/caboose/role_plugin.rb
caboose-cms-0.2.44 app/models/caboose/role_plugin.rb
caboose-cms-0.2.43 app/models/caboose/role_plugin.rb
caboose-cms-0.2.42 app/models/caboose/role_plugin.rb
caboose-cms-0.2.41 app/models/caboose/role_plugin.rb
caboose-cms-0.2.40 app/models/caboose/role_plugin.rb
caboose-cms-0.2.39 app/models/caboose/role_plugin.rb