Class: Hyrax::CollectionTypeParticipant

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/hyrax/collection_type_participant.rb

Constant Summary collapse

MANAGE_ACCESS =
'manage'.freeze
CREATE_ACCESS =
'create'.freeze
GROUP_TYPE =
'group'.freeze
USER_TYPE =
'user'.freeze

Instance Method Summary collapse

Instance Method Details

#creator?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'app/models/hyrax/collection_type_participant.rb', line 23

def creator?
  access == CREATE_ACCESS
end

#labelObject


27
28
29
30
31
32
33
34
35
36
37
# File 'app/models/hyrax/collection_type_participant.rb', line 27

def label
  return agent_id unless agent_type == GROUP_TYPE
  case agent_id
  when ::Ability.registered_group_name
    I18n.t('hyrax.admin.admin_sets.form_participant_table.registered_users')
  when ::Ability.admin_group_name
    I18n.t('hyrax.admin.admin_sets.form_participant_table.admin_users')
  else
    agent_id
  end
end

#manager?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'app/models/hyrax/collection_type_participant.rb', line 19

def manager?
  access == MANAGE_ACCESS
end