1 class Repository < ArvadosModel
4 include CommonApiTemplate
6 api_accessible :user, extend: :common do |t|
13 super || self.name && "git@git.#{Rails.configuration.uuid_prefix}.arvadosapi.com:#{self.name}.git"
22 def permission_to_create
23 current_user and current_user.is_admin
26 def permission_to_update
27 return false if not current_user
28 return true if current_user.is_admin
29 # For normal objects, this is a way to check whether you have
30 # write permission. Repositories should be brought closer to the
31 # normal permission model during #4253. Meanwhile, we'll
32 # special-case this so arv-git-httpd can detect write permission:
33 return super if changed_attributes.keys - ['modified_at', 'updated_at'] == []