diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-12 03:16:29 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-20 08:14:58 +0300 |
commit | b2e5b57fab4d73a5ad043d82457268fdb3864a89 (patch) | |
tree | 0af9e6ba08d6d119ed34f84a9635a65088f85287 /app/controllers/projects/forks_controller.rb | |
parent | 2b05bf4be5c01c2b6b09a8c0792d1c9dd8afe6e7 (diff) |
Add fork button and implement ability to distinguish between public and protected forks. #2406
Diffstat (limited to 'app/controllers/projects/forks_controller.rb')
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 2e01352169d..bcb64479cbf 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -4,7 +4,10 @@ class Projects::ForksController < Projects::ApplicationController before_action :authorize_download_code! def index - @forked_projects = project.forks.includes(:creator) + @all_forks = project.forks.includes(:creator) + @public_forks, @protected_forks = @all_forks.partition do |project| + can?(current_user, :read_project, project) + end end def new |