class Hydra::Grouper::InstitutionFunctionSet

A container object that exposes convenience methods related to the underlying institution_functions set.

For a given InstitutionFunctionSet we can ask “are you an admin?”

Public Class Methods

new(institution_functions: []) click to toggle source
# File lib/hydra/grouper/institution_function_set.rb, line 7
def initialize(institution_functions: [])
  @institution_functions = institution_functions
end

Public Instance Methods

admin?() click to toggle source
# File lib/hydra/grouper/institution_function_set.rb, line 11
def admin?
  @institution_functions.detect { |institution_function| institution_function.name == 'admin' }
end
superadmin?() click to toggle source
# File lib/hydra/grouper/institution_function_set.rb, line 15
def superadmin?
  @institution_functions.detect { |institution_function| institution_function.name == 'superadmin' }
end