Resoved issues for managing workshop facilitators

This commit is contained in:
Godwin
2016-06-05 12:45:02 -07:00
parent ac915f3577
commit 7a7bb7b579
6 changed files with 71 additions and 35 deletions
+8
View File
@@ -62,6 +62,14 @@ class Workshop < ActiveRecord::Base
creator?(user) || collaborator?(user) || conference.host?(user)
end
def can_remove?(owner, facilitator)
# creators cannot be removed
return false if creator?(facilitator)
# creator can remove anyone, facilitators can remove themselves
return creator?(owner) || owner.id == facilitator.id
end
def can_delete?(user)
creator?(user) || conference.host?(user)
end