core/rails/app/controllers/roles_controller.rb
# For now, everyone can see all the roles.
# This may change iff we tenant them.
For now, everyone can see all the roles.
This may change iff we tenant them.
For now everyone can see all the roles . This may change iff we tenant them .
def index
    @list = if params.include? :deployment_id
              find_key_cap(Deployment, params[:deployment_id], cap("READ","DEPLOYMENT")).roles
            elsif params.include? :node_id
              find_key_cap(Node,params[:node_id],cap("READ","NODE")).roles
            else
              Role.all
            end.visible(cap("READ"),@current_user.id)
    respond_to do |format|
      format.html { }
      format.json { render api_index model, @list }
    end
  end
def index @list = if params . include? :deployment_id find_key_cap ( Deployment , params [ :deployment_id ] , cap ( "READ" , "DEPLOYMENT" ) ) . roles elsif params . include? :node_id find_key_cap ( Node , params [ :node_id ] , cap ( "READ" , "NODE" ) ) . roles else Role . all end . visible ( cap ( "READ" ) , @current_user . id ) respond_to do | format | format . html { } format . json { render api_index model , @list } end end
For now, everyone can see all the roles.
For now everyone can see all the roles .