Allow plugins to reparent projects for non-administrators
This allows code reuse for plugins that want to reparent projects for non-administrator users. Change-Id: I883a0f83eb35e7c957f3f3b31a683a13aa14ff09 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -60,11 +60,17 @@ public class SetParent implements RestModifyView<ProjectResource, Input> {
|
||||
}
|
||||
|
||||
@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,
|
||||
ResourceNotFoundException, UnprocessableEntityException, IOException {
|
||||
ProjectControl ctl = rsrc.getControl();
|
||||
validateParentUpdate(ctl, input.parent, true);
|
||||
validateParentUpdate(ctl, input.parent, checkIfAdmin);
|
||||
IdentifiedUser user = (IdentifiedUser) ctl.getCurrentUser();
|
||||
try {
|
||||
MetaDataUpdate md = updateFactory.create(rsrc.getNameKey());
|
||||
|
||||
Reference in New Issue
Block a user