Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When forking a private repository give the forked owner read-only per…

…missions to the repository
  • Loading branch information...
commit 835f7ff8dff830bebf889d916b25eca2fad58aa6 1 parent 58b1359
@icefox authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 web/app/models/repository.rb
View
5 web/app/models/repository.rb
@@ -52,6 +52,11 @@ def copy(other)
if !other.authorized(User.find_by_username(I18n.t('user.all')))
permissions.clear
+ # Give ro permissions to the owner of the repository I forked from.
+ permission = Permission.new
+ permission.mode = 'ro'
+ permission.user_id = other.user.id
+ permissions << permission
end
self.forked_repository_id = other.id
end
Please sign in to comment.
Something went wrong with that request. Please try again.