Class: AtlasRb::Admin::Work
- Inherits:
-
Object
- Object
- AtlasRb::Admin::Work
- Extended by:
- FaradayHelper
- Defined in:
- lib/atlas_rb/admin/work.rb
Overview
Destructive lifecycle operations on a Work.
See AtlasRb::Admin for the rationale behind the namespace and the
confirm: :i_understand friction marker.
Constant Summary collapse
- ROUTE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Atlas REST endpoint prefix.
"/works/"
Class Method Summary collapse
-
.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Hard-delete a Work.
-
.restore(id, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Restore a previously-tombstoned Work.
Methods included from FaradayHelper
connection, multipart, system_connection
Class Method Details
.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Hard-delete a Work.
Removes the Work, its FileSets, and their Blobs from Atlas storage. Unrecoverable — prefer Work.tombstone for the user-visible withdrawal path. This is operator-only.
36 37 38 39 40 41 42 |
# File 'lib/atlas_rb/admin/work.rb', line 36 def self.destroy(id, confirm:, nuid: nil, on_behalf_of: nil) unless confirm == :i_understand raise ArgumentError, "AtlasRb::Admin::Work.destroy requires confirm: :i_understand" end connection({}, nuid, on_behalf_of: on_behalf_of).delete(ROUTE + id) end |
.restore(id, nuid: nil, on_behalf_of: nil) ⇒ Faraday::Response
Restore a previously-tombstoned Work.
Reverses a withdrawal: search and show pages stop returning a withdrawn stub. Operator-only; typically driven from a Rails console or a future admin panel after the library has decided a withdrawn Work should come back.
61 62 63 |
# File 'lib/atlas_rb/admin/work.rb', line 61 def self.restore(id, nuid: nil, on_behalf_of: nil) connection({}, nuid, on_behalf_of: on_behalf_of).post(ROUTE + id + '/restore') end |