Add role checks for ProgrammingGroup
So far, a programming group is always considered to be a learner. While we could, technically, consider it to be a teacher or an admin if all members have this role, this behaviour might have unintended side effects.
This commit is contained in:
@ -28,6 +28,18 @@ class ProgrammingGroup < ApplicationRecord
|
||||
false
|
||||
end
|
||||
|
||||
def learner?
|
||||
true
|
||||
end
|
||||
|
||||
def teacher?
|
||||
false
|
||||
end
|
||||
|
||||
def admin?
|
||||
false
|
||||
end
|
||||
|
||||
def self.parent_resource
|
||||
Exercise
|
||||
end
|
||||
|
Reference in New Issue
Block a user