2012-08-17 14:40:57 +01:00
|
|
|
# -*- encoding : utf-8 -*-
|
|
|
|
class Api::V1::RepositoriesController < Api::V1::BaseController
|
2012-09-26 18:15:11 +01:00
|
|
|
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
skip_before_filter :authenticate_user!, :only => [:show] if APP_CONFIG['anonymous_access']
|
2012-08-17 14:40:57 +01:00
|
|
|
|
|
|
|
load_and_authorize_resource :repository, :through => :platform, :shallow => true
|
2012-09-26 18:15:11 +01:00
|
|
|
|
|
|
|
def show
|
2012-10-14 13:00:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2012-10-14 13:39:58 +01:00
|
|
|
update_subject @repository
|
2012-10-14 13:00:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def add_member
|
2012-10-14 13:39:58 +01:00
|
|
|
add_member_to_subject @repository
|
2012-10-14 13:00:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def remove_member
|
2012-10-14 13:39:58 +01:00
|
|
|
remove_member_from_subject @repository
|
2012-10-14 13:00:49 +01:00
|
|
|
end
|
2012-09-26 18:15:11 +01:00
|
|
|
|
2012-10-14 13:00:49 +01:00
|
|
|
def destroy
|
2012-10-14 13:39:58 +01:00
|
|
|
destroy_subject @repository
|
2012-09-26 18:15:11 +01:00
|
|
|
end
|
|
|
|
|
2012-08-17 14:40:57 +01:00
|
|
|
end
|