LOTS of stuff

This commit is contained in:
jomo
2014-04-04 01:08:17 +02:00
parent 0604bbce63
commit f290258f26
62 changed files with 1457 additions and 655 deletions

View File

@@ -12,4 +12,12 @@ class Forumgroup < ActiveRecord::Base
def to_s
name
end
def can_read?(user)
role_read.nil? || (!user.nil? && user.role >= role_read)
end
def can_write?(user)
!user.nil? && can_read?(user) && user.confirmed? && (role_write.nil? || user.role >= role_write)
end
end