FIX sync repo operate
This commit is contained in:
parent
2d9b2cd942
commit
f7978b9b32
|
@ -9,4 +9,9 @@ module OperateProjectAbilityAble
|
|||
render_forbidden('你没有权限操作.')
|
||||
end
|
||||
|
||||
def authorizate_user_can_edit_repo!
|
||||
return if @repo.project.manager?(current_user) || current_user.admin?
|
||||
render_forbidden('你没有权限操作.')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class RepositoriesController < ApplicationController
|
|||
before_action :require_login, only: %i[edit update create_file update_file delete_file sync_mirror]
|
||||
before_action :find_project, except: [:tags, :commit, :sync_mirror]
|
||||
before_action :authorizate!, except: [:sync_mirror, :tags, :commit]
|
||||
before_action :authorizate_user_can_edit_project!, only: %i[sync_mirror]
|
||||
before_action :authorizate_user_can_edit_repo!, only: %i[sync_mirror]
|
||||
before_action :find_repository_by_id, only: %i[commit sync_mirror tags]
|
||||
|
||||
def show
|
||||
|
|
Loading…
Reference in New Issue