Sha256: 9b77f5ae0cd440c8dab761efc949b80ca2fe0c2b90f4b7e1290e342581403206

Contents?: true

Size: 666 Bytes

Versions: 71

Compression:

Stored size: 666 Bytes

Contents

class Caboose::PermissionPlugin < Caboose::CaboosePlugin

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

Version data entries

71 entries across 71 versions & 1 rubygems

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