2017-04-03 20:00:51 +00:00
|
|
|
class Projects::ProtectedTagsController < Projects::ProtectedRefsController
|
|
|
|
protected
|
2017-03-15 22:29:07 +00:00
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def protected_ref
|
|
|
|
@protected_tag
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def protected_ref=(val)
|
|
|
|
@protected_tag = val
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def matching_refs=(val)
|
|
|
|
@matching_tags = val
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def project_refs
|
|
|
|
@project.repository.tags
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def create_service
|
|
|
|
::ProtectedTags::CreateService
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def update_service
|
|
|
|
::ProtectedTags::UpdateService
|
|
|
|
end
|
2017-03-15 22:29:07 +00:00
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def load_protected_ref
|
|
|
|
self.protected_ref = @project.protected_tags.find(params[:id])
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
|
2017-04-03 20:00:51 +00:00
|
|
|
def protected_ref_params
|
2017-04-04 02:37:22 +00:00
|
|
|
params.require(:protected_tag).permit(:name, create_access_levels_attributes: [:access_level, :id])
|
2017-03-15 22:29:07 +00:00
|
|
|
end
|
|
|
|
end
|