Merge "Allow plugins to reparent projects for non-administrators"
This commit is contained in:
@@ -60,11 +60,17 @@ public class SetParent implements RestModifyView<ProjectResource, Input> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apply(final ProjectResource rsrc, Input input)
|
public String apply(ProjectResource rsrc, Input input) throws AuthException,
|
||||||
|
ResourceConflictException, ResourceNotFoundException,
|
||||||
|
UnprocessableEntityException, IOException {
|
||||||
|
return apply(rsrc, input, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String apply(ProjectResource rsrc, Input input, boolean checkIfAdmin)
|
||||||
throws AuthException, ResourceConflictException,
|
throws AuthException, ResourceConflictException,
|
||||||
ResourceNotFoundException, UnprocessableEntityException, IOException {
|
ResourceNotFoundException, UnprocessableEntityException, IOException {
|
||||||
ProjectControl ctl = rsrc.getControl();
|
ProjectControl ctl = rsrc.getControl();
|
||||||
validateParentUpdate(ctl, input.parent, true);
|
validateParentUpdate(ctl, input.parent, checkIfAdmin);
|
||||||
IdentifiedUser user = (IdentifiedUser) ctl.getCurrentUser();
|
IdentifiedUser user = (IdentifiedUser) ctl.getCurrentUser();
|
||||||
try {
|
try {
|
||||||
MetaDataUpdate md = updateFactory.create(rsrc.getNameKey());
|
MetaDataUpdate md = updateFactory.create(rsrc.getNameKey());
|
||||||
|
Reference in New Issue
Block a user