diff --git a/app/models/team.rb b/app/models/team.rb index c25963905..72df05097 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -31,7 +31,7 @@ class Team < ApplicationRecord validates :name, uniqueness: {scope: :organization_id} - enum authorize: {common: 0, read: 1, write: 2, admin: 3, owner: 4} + enum authorize: {read: 1, write: 2, admin: 3, owner: 4} def self.build(organization_id, name, nickname, description, authorize, includes_all_project, can_create_org_project) self.create!(organization_id: organization_id, diff --git a/app/models/team_unit.rb b/app/models/team_unit.rb index c757cc684..fdd1b975b 100644 --- a/app/models/team_unit.rb +++ b/app/models/team_unit.rb @@ -20,7 +20,7 @@ class TeamUnit < ApplicationRecord belongs_to :organization belongs_to :team - enum unit_type: {code: 1, issues: 2, pulls: 3, releases: 4} + enum unit_type: {code: 1, issues: 2, pulls: 3, wiki: 4, releases: 5} validates :unit_type, uniqueness: { scope: [:organization_id, :team_id]} diff --git a/app/services/organizations/teams/create_service.rb b/app/services/organizations/teams/create_service.rb index c3fc5f599..3aeb23db5 100644 --- a/app/services/organizations/teams/create_service.rb +++ b/app/services/organizations/teams/create_service.rb @@ -37,7 +37,7 @@ class Organizations::Teams::CreateService < ApplicationService end def authorize - params[:authorize].present? ? params[:authorize] : "common" + params[:authorize].present? ? params[:authorize] : "read" end def includes_all_project @@ -54,7 +54,7 @@ class Organizations::Teams::CreateService < ApplicationService end def units_params - %w(admin owner).include?(authorize) ? %w(code issues pulls releases) : params[:unit_types] + %w(admin owner).include?(authorize) ? %w(code issues pulls wiki releases) : params[:unit_types] end def create_units