diff --git a/app/models/grant.rb b/app/models/grant.rb index 452b6d1b..7b93921a 100644 --- a/app/models/grant.rb +++ b/app/models/grant.rb @@ -158,6 +158,13 @@ def requires_one_criteria errors.add(:base, 'Must have at least one review criteria.') end + # def admins, def editors, def viewers + GrantPermission::ROLES.each do |_,role| + define_method "#{role.pluralize}".to_sym do + grant_permissions.send("role_#{role}").to_a.map(&:user) + end + end + private def set_default_state