New Feature: Change Artifact Owner(ship)#2731
Conversation
|
Thank you for creating a pull request! Pinging @carlesarnal to respond or triage. |
…rio-registry into feat/change-ownership
|
Note that some changes to the access controllers was necessary because a new type of access was added: "Owner or Admin" This new level of access just says that an operation can be performed either by the owner of the artifact or by an Admin. This logic required some refactoring of the access controllers. |
carlesarnal
left a comment
There was a problem hiding this comment.
LGTM, with the small comment about the super vs delegate.
| @Override | ||
| public void updateArtifactOwner(String groupId, String artifactId, ArtifactOwnerDto owner) throws ArtifactNotFoundException, RegistryStorageException { | ||
| super.updateArtifactOwner(groupId, artifactId, owner); | ||
| //TODO consider a change ownership event |
There was a problem hiding this comment.
Maybe the delegate should be used here instead of super? btw, I agree, adding an event here makes sense :)
There was a problem hiding this comment.
It probably makes sense to just remove any of the methods that do nothing but call the delegate, since the parent class is already doing that. Usually when you extend a class in this way that's what you do, so that the subclass only overrides the functionality it needs. But I've made the change you suggested instead because I don't feel very strongly about it and using the delegate directly is what we're doing everywhere else. So +1 for consistency.
|
@smccarthy-ie FYI - this is part of the Change Owner functionality we've discussed recently. |
Overview
This PR adds support for changing the owner of an Artifact. Support is only added to the REST API. A future PR will add support via the UI and another for the CLI.
There are two new REST API operations (for one new endpoint):
Get Artifact Owner
Update Artifact Owner
Note that the
Update Artifact Owneroperation is unique in that it can be called successfully only by the current owner of the artifact or by a user with the Admin role.