2012-08-17 14:40:57 +01:00
|
|
|
# -*- encoding : utf-8 -*-
|
|
|
|
class Api::V1::ProjectsController < Api::V1::BaseController
|
2012-09-26 18:15:11 +01:00
|
|
|
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
skip_before_filter :authenticate_user!, :only => [:get_id, :show] if APP_CONFIG['anonymous_access']
|
|
|
|
|
2012-08-28 17:57:12 +01:00
|
|
|
load_and_authorize_resource
|
2012-08-17 14:40:57 +01:00
|
|
|
|
2012-08-28 17:57:12 +01:00
|
|
|
def get_id
|
|
|
|
if @project = Project.find_by_owner_and_name(params[:owner], params[:name])
|
|
|
|
authorize! :show, @project
|
|
|
|
else
|
2012-09-27 00:54:56 +01:00
|
|
|
raise ActiveRecord::RecordNotFound
|
2012-08-28 17:57:12 +01:00
|
|
|
end
|
2012-08-17 14:40:57 +01:00
|
|
|
end
|
2012-09-26 18:15:11 +01:00
|
|
|
|
|
|
|
def show
|
|
|
|
|
|
|
|
end
|
2012-08-17 14:40:57 +01:00
|
|
|
end
|