r18551@gaspard (orig r1815): jplang | 2008-09-13 18:45:01 +0200

Adds a permission 'view wiki edits' so that wiki history can be hidden to certain users (#1154).
 A migration automatically adds this permission to roles that were allowed to view wiki pages.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1844 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Nicolas Chuche
2008-09-14 15:35:10 +00:00
parent b6e15f96e4
commit 3810bac939
7 changed files with 34 additions and 5 deletions
+5
View File
@@ -76,6 +76,11 @@ class Role < ActiveRecord::Base
save!
end
# Returns true if the role has the given permission
def has_permission?(perm)
!permissions.nil? && permissions.include?(perm.to_sym)
end
def <=>(role)
position <=> role.position
end