Disables Grant's "Funder" property edit by other than creation user.
This commit is contained in:
parent
efde5fe5a3
commit
44973ef3a9
|
@ -453,6 +453,14 @@ public class DataManagementPlanManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newDmp.getGrant().getId() != null) {
|
||||||
|
Grant grant = apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().find(newDmp.getGrant().getId());
|
||||||
|
if ( !grant.getFunder().getId().equals(newDmp.getGrant().getFunder().getId()) && !newDmp.getGrant().getCreationUser().getId().equals(user.getId())){
|
||||||
|
throw new Exception("User is not the owner of the Grant therefore, cannot edit it");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newDmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().createOrUpdate(newDmp);
|
newDmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().createOrUpdate(newDmp);
|
||||||
|
|
||||||
// Dataset manipulation for when the DMP is set to be finalized.
|
// Dataset manipulation for when the DMP is set to be finalized.
|
||||||
|
|
Loading…
Reference in New Issue