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

@@ -13,4 +13,12 @@ class Forum < ActiveRecord::Base
def group
forumgroup
end
end
def can_read?(user)
group.can_read?(user) && (role_read.nil? || (!user.nil? && user.role >= role_read))
end
def can_write?(user)
group.can_read?(user) && can_read?(user) && (role_write.nil? || (!user.nil? && user.role >= role_write))
end
end