Sha256: aa388529efce147f36f32bba0025ebe01dcdba73ffefb4453770f9d83ecd1498

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

module Ixtlan
  module Guard
    module Controllers
      module PermissionsController
        
        # GET /permissions
        # GET /permissions.xml
        # GET /permissions.json
        def index
          respond_to do |format|
            format.html
            format.xml  { render :xml => guard.permissions(self).to_xml }
            format.json  { render :json => guard.permissions(self).to_json }
          end
        end
        
        # GET /permissions/1
        # GET /permissions/1.xml
        # GET /permissions/1.json
        def show
          controller = Object.new
          def controller.current_user(u = nil)
            @u = u if u
            @u
          end
          if defined? ::DataMapper
            controller.current_user(current_user.class.get(params[:id]))
          else
            controller.current_user(current_user.class.find(params[:id]))
          end
          
          respond_to do |format|
            format.html
            format.xml  { render :xml => guard.permissions(controller).to_xml }
            format.json  { render :json => guard.permissions(controller).to_json }
          end
        end      
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ixtlan-guard-0.7.0 lib/ixtlan/guard/controllers/permissions_controller.rb
ixtlan-guard-0.6.1 lib/ixtlan/guard/controllers/permissions_controller.rb
ixtlan-guard-0.6.0 lib/ixtlan/guard/controllers/permissions_controller.rb
ixtlan-guard-0.5.0 lib/ixtlan/guard/controllers/permissions_controller.rb
ixtlan-guard-0.4.1 lib/ixtlan/guard/controllers/permissions_controller.rb
ixtlan-guard-0.4.0 lib/ixtlan/guard/controllers/permissions_controller.rb