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