mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
27 lines
528 B
Ruby
27 lines
528 B
Ruby
class Projects::ApplicationController < ApplicationController
|
|
before_filter :project
|
|
before_filter :repository
|
|
layout :determine_layout
|
|
|
|
def authenticate_user!
|
|
# Restrict access to Projects area only
|
|
# for non-signed users
|
|
if !current_user
|
|
id = params[:project_id] || params[:id]
|
|
@project = Project.find_with_namespace(id)
|
|
|
|
return if @project && @project.public
|
|
end
|
|
|
|
super
|
|
end
|
|
|
|
def determine_layout
|
|
if current_user
|
|
'projects'
|
|
else
|
|
'public'
|
|
end
|
|
end
|
|
end
|