diff --git a/app/models/member.rb b/app/models/member.rb index 24c319e0af..0e6774c78e 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -34,8 +34,6 @@ class Member < ActiveRecord::Base has_many :roles, :through => :member_roles belongs_to :project - attr_protected :project_id, :user_id, :role_ids - validates_presence_of :principal, :project validates_uniqueness_of :user_id, :scope => :project_id diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb index 7a407a3152..d9ac6b0e8e 100644 --- a/app/models/permitted_params.rb +++ b/app/models/permitted_params.rb @@ -85,7 +85,7 @@ class PermittedParams < Struct.new(:params, :user) def custom_field_type params.require(:type) end - + def enumeration_type params.require(:type) end @@ -116,6 +116,10 @@ class PermittedParams < Struct.new(:params, :user) permitted_params end + def member + params.require(:member).permit(*self.class.permitted_attributes[:member]) + end + def planning_element_type params.require(:planning_element_type).permit(*self.class.permitted_attributes[:planning_element_type]) end @@ -274,6 +278,8 @@ class PermittedParams < Struct.new(:params, :user) :membership => [ :project_id, :role_ids => []]], + :member => [ + :role_ids], :new_work_package => [ :subject, :description, @@ -363,7 +369,7 @@ class PermittedParams < Struct.new(:params, :user) :redirect_existing_links ], :wiki_content => [ :comments, - :text, + :text, :lock_version ], :move_to => [ :move_to ] }