def init_resource_for_role(role, resource_param=:id)
@resource=Project.by_key(params[resource_param])
- unless @resource
+ unless @resource && @resource.enabled
flash[:error] = message('dashboard.project_not_found')
redirect_to :controller => :dashboard, :action => :index
else
#
class ComponentsController < ApplicationController
+ before_filter :init_resource_for_user_role
+
helper :metrics, :components
SECTION = Navigation::SECTION_RESOURCE
def index
- init_resource_for_user_role
@components_configuration = Sonar::ComponentsConfiguration.new
@snapshots = Snapshot.all(:include => 'project', :conditions => ['snapshots.parent_snapshot_id=?', @snapshot.id])