Allows multiple roles on the same project (#706). Prerequisite for user groups feature.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2726 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-05-10 10:54:31 +00:00
parent 814e138c2a
commit 7dccf9fda6
65 changed files with 340 additions and 175 deletions
+7 -2
View File
@@ -38,7 +38,8 @@ class Role < ActiveRecord::Base
end
end
has_many :members
has_many :member_roles, :dependent => :destroy
has_many :members, :through => :member_roles
acts_as_list
serialize :permissions, Array
@@ -82,7 +83,11 @@ class Role < ActiveRecord::Base
end
def <=>(role)
position <=> role.position
role ? position <=> role.position : -1
end
def to_s
name
end
# Return true if the role is a builtin role