mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-13 12:47:11 +08:00
22 lines
462 B
Ruby
22 lines
462 B
Ruby
|
class RepositoriesController < ApplicationController
|
||
|
before_action :load_vars
|
||
|
before_action :check_view_all_permissions, only: :index
|
||
|
|
||
|
def index
|
||
|
render('repositories/index')
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def load_vars
|
||
|
@team = Team.find_by_id(params[:team_id])
|
||
|
@repositories = @team.repositories.order(created_at: :asc)
|
||
|
|
||
|
render_404 unless @team
|
||
|
end
|
||
|
|
||
|
def check_view_all_permissions
|
||
|
render_403 unless can_view_team_repositories(@team)
|
||
|
end
|
||
|
end
|