• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

curationexperts / laevigata / 0d10b93f-7d12-4108-bfd7-303659b33b6c

18 Jun 2025 03:38AM UTC coverage: 97.41% (-0.001%) from 97.411%
0d10b93f-7d12-4108-bfd7-303659b33b6c

Pull #2464

circleci

mark-dce
Disable embargo expiration notifications

Per discussions with SCO, they wish to reduce administrative overhead
by eliminating embargo expiration notifications.

We still need to process actual embargo expirations to change the
corresponding ETDs from a restricted to open status.

Therefore, this change leaves the schedule and service code in place
and simply comments out the calls to notification processing so that
we still get nightly expiration processing.
Pull Request #2464: Disable embargo expiration notifications

4 of 4 new or added lines in 1 file covered. (100.0%)

43 existing lines in 7 files now uncovered.

2821 of 2896 relevant lines covered (97.41%)

52.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.87
/app/models/ability.rb
1
class Ability
4✔
2
  include Hydra::Ability
4✔
3
  include Hyrax::Ability
4✔
4
  self.ability_logic += [:everyone_can_create_curation_concerns, :ipe_permissions]
4✔
5

6
  # Define any customized permissions here.
7
  def custom_permissions
4✔
8
    if can_review_submissions?
347✔
9
      can [:manage], String do |id|
82✔
10
        approver_for?(admin_set: ActiveFedora::Base.find(id)&.admin_set)
11✔
11
      end
12

13
      can [:manage], ActiveFedora::Base do |obj|
82✔
UNCOV
14
        approver_for?(admin_set: obj.admin_set)
1✔
15
      end
16
    end
17
    return unless admin?
347✔
18
    can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role
53✔
19
    can [:destroy], ActiveFedora::Base
53✔
20
    can [:read], Schools::School
53✔
21
    can [:manage], RegistrarFeed
53✔
22
  end
23

24
  def test_download(id)
4✔
25
    super || can_review_submissions?
×
26
  end
27

28
  def curation_concerns_permissions
4✔
29
    alias_action :versions, to: :update
347✔
30
    alias_action :file_manager, to: :update
347✔
31

32
    return if admin?
347✔
33
    cannot [:update, :edit, :manage, :index], Hydra::AccessControls::Embargo
294✔
34
    cannot :index, Hydra::AccessControls::Lease
294✔
35
  end
36

37
  def ipe_permissions
4✔
38
    can :create, InProgressEtd if registered_user?
347✔
39
    can :update, InProgressEtd, user_ppid: current_user.ppid
347✔
40

41
    # A user who has permission to edit the corresponding Etd should be able to edit the InProgressEtd. (e.g. admin users, proxy permissions, etc)
42
    can :update, InProgressEtd do |ipe|
347✔
43
      begin
44
        unless ipe.etd_id.blank?
27✔
45
          etd_doc = SolrDocument.find ipe.etd_id
9✔
46
          can? :edit, etd_doc
8✔
47
        end
48
      rescue Blacklight::Exceptions::RecordNotFound
49
        false
1✔
50
      end
51
    end
52
  end
53

54
  ##
55
  # @note We always display the share button for every user. Rather than
56
  #   expressing this through the complex states of AdminSets and user
57
  #   permissions, we can just always return true in this presenter.
58
  #
59
  # @return [Boolean]
60
  def display_share_button?
4✔
61
    true
×
62
  end
63

64
  private
4✔
65

66
    def approver_for?(admin_set:)
4✔
67
      return false unless admin_set
12✔
68

69
      workflow = admin_set.active_workflow
12✔
70
      Hyrax::Workflow::PermissionQuery
12✔
71
        .scope_processing_workflow_roles_for_user_and_workflow(user:     @user,
72
                                                               workflow: workflow)
73
        .pluck(:role_id)
74
        .map { |id| Sipity::Role.find(id).name }
36✔
75
        .include?('approving')
76
    end
77
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc