atlas_rb 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +1 -1
- data/lib/atlas_rb/system/work.rb +32 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0650d39388fca9d7fbdc0134ee4e76e4a82ed3c659f8c44ea96aac62a397d0c1
|
|
4
|
+
data.tar.gz: ab674da7f6274991b11921b60c43a93ea6e3e9f3a5ef121109fd3bc99c970cdc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c23136adc3f95ccf1b9e0e739f95a2a86b3ee33a1cf5a52f72af625fe5c2ab77cf63c9c78990d2b36ff0d285445f56bae620da21d86af0994d590f867defe51
|
|
7
|
+
data.tar.gz: edac22a77b8d592ae2e3a0d77117b9ac60d7516d3a13469747ff5cb7f90a782e774d5514218bb5d368818defc538d58158ed608abd400d2cca4aaa606bff9939
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.21.0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.21.0
|
|
4
|
+
|
|
5
|
+
### Added — `System::Work.remove_linked_member`, unlinking a showcase Work
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
AtlasRb::System::Work.remove_linked_member(work_id, old_showcase_id, on_behalf_of: depositor_nuid)
|
|
9
|
+
# => ["def456"]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The mirror of `System::Work.add_linked_member`, over the same system connection.
|
|
13
|
+
It binds `DELETE /works/:id/linked_members/:collection_id`, which Atlas already
|
|
14
|
+
serves. Atlas runs the same two checks as the add: the Collection must be
|
|
15
|
+
featured, and `on_behalf_of` must own the Work. Otherwise it raises
|
|
16
|
+
`ForbiddenError`.
|
|
17
|
+
|
|
18
|
+
A depositor holds no `:link_member` grant, so `Work.remove_linked_member` works
|
|
19
|
+
only for an admin. This binding lets Cerberus change a depositor's showcase
|
|
20
|
+
category: remove the link to the old showcase, then add the link to the new one.
|
|
21
|
+
|
|
3
22
|
## 1.20.0
|
|
4
23
|
|
|
5
24
|
### Added — `System.release_embargoes`, recording lapsed embargoes
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/system/work.rb
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
module AtlasRb
|
|
4
4
|
module System
|
|
5
|
-
# Showcase publishing: link a
|
|
5
|
+
# Showcase publishing: link a depositor's Work into (or out of) a
|
|
6
6
|
# featured showcase Collection on their behalf, without granting the
|
|
7
7
|
# depositor themselves standing edit rights on that shared Collection.
|
|
8
8
|
#
|
|
9
9
|
# Atlas scopes this narrowly on both sides (see Atlas's `Ability`): the
|
|
10
10
|
# target Collection must be `featured`, and the Work must belong to the
|
|
11
11
|
# `on_behalf_of` NUID — never an arbitrary or private Work. Cerberus's
|
|
12
|
-
# `WorkDeposit#create_published` ("Publish to my community")
|
|
13
|
-
#
|
|
12
|
+
# `WorkDeposit#create_published` ("Publish to my community") adds the link;
|
|
13
|
+
# changing a Work's showcase category swaps it with a remove and an add.
|
|
14
14
|
#
|
|
15
15
|
# Always authenticates via {FaradayHelper#system_connection}, so there is
|
|
16
16
|
# no way to issue this as a regular user.
|
|
@@ -43,6 +43,35 @@ module AtlasRb
|
|
|
43
43
|
.post("/works/#{work_id}/linked_members")&.body
|
|
44
44
|
)
|
|
45
45
|
end
|
|
46
|
+
|
|
47
|
+
# The mirror of {.add_linked_member}: unlink a depositor's Work from a
|
|
48
|
+
# featured showcase Collection on their behalf. Atlas applies the same
|
|
49
|
+
# two checks as the add, so a depositor can undo only a link they could
|
|
50
|
+
# have made.
|
|
51
|
+
#
|
|
52
|
+
# @param work_id [String] the Work ID to unlink.
|
|
53
|
+
# @param collection_id [String] the (must-be-featured) showcase
|
|
54
|
+
# Collection to unlink the Work from.
|
|
55
|
+
# @param on_behalf_of [String] the depositor NUID this write is
|
|
56
|
+
# attributed to; Atlas requires it to match the Work's depositor.
|
|
57
|
+
# @return [Array<String>] the Work's full set of linked Collection
|
|
58
|
+
# noids after the remove.
|
|
59
|
+
# @raise [AtlasRb::StaleResourceError] optimistic-lock conflict.
|
|
60
|
+
# @raise [AtlasRb::LinkedMemberError] structural rejection (HTTP 422) —
|
|
61
|
+
# e.g. the target Collection does not exist.
|
|
62
|
+
# @raise [AtlasRb::ForbiddenError] Atlas refused the unlink (HTTP 403) —
|
|
63
|
+
# e.g. the target Collection isn't featured, or on_behalf_of doesn't
|
|
64
|
+
# own the Work.
|
|
65
|
+
#
|
|
66
|
+
# @example Swapping a Work's showcase from Cerberus's Work Edit page
|
|
67
|
+
# AtlasRb::System::Work.remove_linked_member(work.id, old_showcase.id, on_behalf_of: depositor_nuid)
|
|
68
|
+
# AtlasRb::System::Work.add_linked_member(work.id, new_showcase.id, on_behalf_of: depositor_nuid)
|
|
69
|
+
def self.remove_linked_member(work_id, collection_id, on_behalf_of:)
|
|
70
|
+
JSON.parse(
|
|
71
|
+
system_connection({}, on_behalf_of: on_behalf_of)
|
|
72
|
+
.delete("/works/#{work_id}/linked_members/#{collection_id}")&.body
|
|
73
|
+
)
|
|
74
|
+
end
|
|
46
75
|
end
|
|
47
76
|
end
|
|
48
77
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: atlas_rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.21.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Cliff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|