Revision 420e07bf
Added by Andreas Kohlbecker almost 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/common/TeamOrPersonField.java | ||
---|---|---|
251 | 251 |
boolean canEdit = teamOrPerson == null || !teamOrPerson.isPersited() || userHelper.userHasPermission(teamOrPerson, CRUD.UPDATE); |
252 | 252 |
if(!canEdit){ |
253 | 253 |
getPropertyDataSource().setReadOnly(true); |
254 |
//setReadOnlyComponents(true); will be set later on automatically by vaadin
|
|
254 |
setReadOnlyComponents(true);
|
|
255 | 255 |
} |
256 | 256 |
} |
257 | 257 |
|
... | ... | |
310 | 310 |
} |
311 | 311 |
|
312 | 312 |
if(hasNullContent()){ |
313 |
if(!getState(false).readOnly && getPropertyDataSource().isReadOnly()){ |
|
314 |
// the TeamOrPersonBase Editor (remove, addPerson, addTeam) is not readonly |
|
315 |
// thus removing the TeamOrPerson is allowed. In case the datasource is readonly |
|
316 |
// due to missing user grants for the TeamOrPerson it must be set to readWrite to |
|
317 |
// before setting to null |
|
318 |
getPropertyDataSource().setReadOnly(false); |
|
319 |
} |
|
313 | 320 |
getPropertyDataSource().setValue(null); |
314 | 321 |
setValue(null); |
315 | 322 |
|
323 |
|
|
316 | 324 |
} |
317 | 325 |
} |
318 | 326 |
|
Also available in: Unified diff
ref #7366 allowing to remove related TeamOrPerson when TeamOrPerson is readonly